Guest User

Kurdesz

a guest
Dec 2nd, 2015
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. package application;
  2.  
  3. import java.beans.EventHandler;
  4.  
  5. import javafx.application.Application;
  6. import javafx.event.ActionEvent;
  7. import javafx.event.*;
  8. import javafx.scene.Scene;
  9. import javafx.scene.control.Button;
  10. import javafx.scene.layout.StackPane;
  11. import javafx.stage.Stage;
  12.  
  13.  
  14. public class Main extends Application {
  15. @Override
  16. public void start(Stage primaryStage) {
  17. Button przycisk = new Button();
  18. przycisk.setText("Przycisk");
  19.  
  20. przycisk.setOnAction(new EventHandler<ActionEvent>(){
  21. @Override
  22. public void handle(ActionEvent arg0){
  23. przycisk.setText("Klik!");
  24. }
  25. });
  26.  
  27. StackPane root = new StackPane();
  28. root.getChildren().add(przycisk);
  29.  
  30. Scene ramka = new Scene(root, 300, 250);
  31.  
  32. primaryStage.setScene(ramka);
  33. primaryStage.show();
  34. }
  35. }
Advertisement
Add Comment
Please, Sign In to add comment