Home:ALL Converter>JAVA FX set window/stage on front of OSX Dock

JAVA FX set window/stage on front of OSX Dock

Ask Time:2015-07-22T18:05:46         Author:Fortune

Json Formatter

I can't get a JAVA FX "FXML" window to get on front of the OSX Dock on Yosemite 10.10.1.

I created a fresh "new JavaFX FXML-enabled application" on NetBeans which gives this code :

public class Test extends Application {
    @Override
    public void start(Stage stage) throws Exception {
       Parent root = FXMLLoader.load(getClass().getResource("FXMLDocument.fxml"));
       Scene scene = new Scene(root);
       stage.setScene(scene);
       stage.show();
       stage.setAlwaysOnTop(true); // I ADDED THIS
     }

     public static void main(String[] args) {
       launch(args);
     }   
}      

I added setAlwaysOnTop() on my stage, but still, my window is always hidden behind the dock.

Window at the left bottom

Is there a way to set my window on front ?

Author:Fortune,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/31560033/java-fx-set-window-stage-on-front-of-osx-dock
yy