问题
My app looks different at same OS. This is Windows 7
rich interface:

And Windows 7
regular interface:

The only thing that makes me angry is sizing. In FXML it's 640x445
, but Windows 7 makes it wider. How can I avoid that? Is there an approach to make TextArea
fullscreen or something?
回答1:
To resize your stage at initialize you can use following code (i assume you use javafx-2?)
//stage.setResizable(true);
Screen screen = Screen.getPrimary();
Rectangle2D bounds = screen.getVisualBounds();
stage.setX(bounds.getMinX());
stage.setY(bounds.getMinY());
stage.setWidth(bounds.getWidth());
stage.setHeight(bounds.getHeight());
or you can use fullscreen mode:
stage.setFullScreen(true);
来源:https://stackoverflow.com/questions/23491944/javafx-window-sizing