Skip to content

Instantly share code, notes, and snippets.

@marsdevapps
Created March 6, 2017 13:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save marsdevapps/4911cc2cf0674423da412f574b170184 to your computer and use it in GitHub Desktop.
Save marsdevapps/4911cc2cf0674423da412f574b170184 to your computer and use it in GitHub Desktop.
Sample01JavaFXApp
public class Sample01JavaFXApp extends Application {
    public static void main(String[] args) {
        Application.launch(args);
    } 
    @Override
    public void start(Stage primaryStage) throws Exception {
        BorderPane root = new BorderPane();
        Button button = new Button("Click Me");
        Alert alert = new Alert(Alert.AlertType.INFORMATION, "Button Clicked", ButtonType.OK);    
alert.setHeaderText("Sample 01 JavaFX");
        button.setOnAction(e -> alert.show());
        root.setCenter(button);
        primaryStage.setScene(new Scene(root, 400, 200));
        primaryStage.setTitle("Sample 01 JavaFX");
        primaryStage.show();
    }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment