Skip to main content

JavaFX - Child Windows

Please note these java.net forums are being decommissioned and use the new and improved forums at https://community.oracle.com/community/java.
No replies
purringpigeon
Offline
Joined: 2014-07-23

Hello,

I am relatively new to JavaFX and am attempting to open a child window, that will close when the parent closes. My app will not be constrained by an out window, so the child windows will "float".

Opening the window as follows accomplishes much of what I would like:
Scene secondScene = new Scene(root, 800, 400);
Stage secondStage = new Stage();
secondStage.setTitle("Window 2.....");
secondStage.setScene(secondScene);
secondStage.initStyle(StageStyle.DECORATED);
secondStage.initModality(Modality.NONE);
secondStage.initOwner(primaryStage);

However, it seems that window 2 ALWAYS sits on top of window 1, even when I select window one. I would like them to be interchangeable without overlap.

Is that possible?