Advertisement
apl-mhd

SetonAction

Nov 25th, 2017
139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.97 KB | None | 0 0
  1. package sample;
  2.  
  3. import javafx.application.Application;
  4. import javafx.event.Event;
  5. import javafx.event.EventHandler;
  6. import javafx.fxml.FXMLLoader;
  7. import javafx.scene.Parent;
  8. import javafx.scene.Scene;
  9. import javafx.scene.control.Button;
  10. import javafx.scene.layout.StackPane;
  11. import javafx.stage.Stage;
  12.  
  13. import java.awt.event.ActionEvent;
  14.  
  15. public class Main extends Application{
  16.  
  17.     Button button;
  18.  
  19.     @Override
  20.     public void start(Stage primaryStage) throws Exception{
  21.  
  22.  
  23.         primaryStage.setTitle("orko");
  24.  
  25.         button = new Button();
  26.  
  27.         button.setText("Orin");
  28.  
  29.         button.setOnAction(e-> System.out.println("bangladesh"));
  30.  
  31.         StackPane layout = new StackPane();
  32.  
  33.         layout.getChildren().add(button);
  34.  
  35.         Scene scene = new Scene(layout,200,200);
  36.  
  37.         primaryStage.setScene(scene);
  38.         primaryStage.show();
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.     }
  46.  
  47.  
  48.     public static void main(String[] args) {
  49.         launch(args);
  50.     }
  51. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement