【发布时间】:2014-01-10 23:55:18
【问题描述】:
这个小型 JavaFX 测试应用程序
import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.layout.BorderPane;
import javafx.scene.paint.Color;
import javafx.scene.shape.Rectangle;
import javafx.stage.Stage;
public class ApplicationWithNonResizableStage extends Application {
public static void main(final String[] args) {
launch(args);
}
@Override
public void start(final Stage primaryStage) throws Exception {
final Rectangle rectangle = new Rectangle(200, 100, Color.POWDERBLUE);
final BorderPane pane = new BorderPane(rectangle);
final Scene scene = new Scene(pane);
primaryStage.setScene(scene);
primaryStage.setResizable(false);
primaryStage.show();
}
}
生成一个带有不需要的填充的窗口:
去掉primaryStage.setResizable(false)的调用也会去掉效果:
出了什么问题?
【问题讨论】:
-
您找到解决方案了吗?它也会影响其他组件:stackoverflow.com/questions/22620919/…
-
@TVK:我只能为舞台解决问题。
-
对我来说似乎是一个错误,您可以考虑在 fx 问题跟踪器中提交问题
标签: java javafx windows-7-x64 javafx-8