My app, if I click the "maximize button", it will maximize the window. But if I go to another scene(in the same stage), the window will restore to the original size. So, how can I control it to keep maximizing?
相关问题
- Delete Messages from a Topic in Apache Kafka
- Jackson Deserialization not calling deserialize on
- How to maintain order of key-value in DataFrame sa
- StackExchange API - Deserialize Date in JSON Respo
- Difference between Types.INTEGER and Types.NULL in
I used
primaryStage.setMaximized(true);
after callingshow();
method in Java 8 implementation. It keeps other scenes maximizing.I had the same problem. I fixed it creating a root stage with that only contains a menu bar and a tool bar, like this:
I initialized this window in the start method with:
Later, when you want to load a FXML file or scene into the root container, you could make it with the next lines in another method:
in that way every scene you add to the root stage will get the size of the root.
This is how I did it: