Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void start(Stage primaryStage) throws Exception {
- primaryStage.setTitle("title");
- Button btn1 = new Button("new");
- Button btn2 = new Button ("continue");
- btn1.setOnAction(this);
- btn2.setOnAction(this);
- VBox vb = new VBox (btn1, btn2);
- vb.setSpacing(10);
- vb.setPadding(new Insets(20));
- BorderPane root = new BorderPane();
- root.setBottom(vb);
- Scene scene = new Scene (root, 300, 250);
- primaryStage.setScene(scene);
- primaryStage.show();
- }
- @Override
- public void handle(ActionEvent event) {
- if (event.getSource()==btn1) {
- System.out.println("new!");
- } else if (event.getSource()==btn2) {
- System.out.println("continue!");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement