Created
February 7, 2017 22:07
-
-
Save bekwam/f1a1b5c9d310978ffc01084eb40846a2 to your computer and use it in GitHub Desktop.
A JavaFX App That Takes Up the Whole Screen (Primary)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class FullScreenApp extends Application { | |
@Override | |
public void start(Stage primaryStage) throws Exception { | |
VBox vbox = new VBox(new Label("Hello, World!")); | |
vbox.setAlignment(Pos.TOP_CENTER); // 0, auto | |
Scene scene = new Scene( vbox ); | |
primaryStage.setScene( scene ); | |
primaryStage.setWidth(Screen.getPrimary().getBounds().getWidth()); | |
primaryStage.setHeight(Screen.getPrimary().getBounds().getWidth()); | |
primaryStage.show(); | |
} | |
public static void main(String[] args) { | |
launch(args); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment