Created
March 6, 2017 13:22
-
-
Save marsdevapps/4911cc2cf0674423da412f574b170184 to your computer and use it in GitHub Desktop.
Sample01JavaFXApp
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 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