Context: In a multi-monitor setup, I start a JavaFx application in Full Screen mode in 1 of the screens. Different applications are open in other screens.
Issue: Once the JavaFx application starts, the moment I click on another application in another screen, the JavaFx app full screen minimizes to the application bar.
Research: I refer to inputs in Link1 Link2 Link3 but in those cases they are trying to change scenes within the same full-screen application. In this case I am clicking on an unrelated application in another screen yet the full screen app minimizes.
Is there a way to prevent this behavior?
Main:
@Override
public void start(Stage primaryStage) throws Exception{
Parent root = FXMLLoader.load(getClass().getResource("sample.fxml"));
primaryStage.setTitle("Hello World");
primaryStage.setScene(new Scene(root, 300, 275));
primaryStage.setFullScreen(true);
primaryStage.show();
}
Controller:
public class Controller {}
FXML:
<GridPane fx:controller="sample.Controller"
xmlns:fx="http://javafx.com/fxml" alignment="center" hgap="10" vgap="10"></GridPane>