Advertisement
Guest User

Untitled

a guest
Apr 6th, 2020
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.93 KB | None | 0 0
  1. package sample;
  2.  
  3. import javafx.application.Application;
  4. import javafx.event.Event;
  5. import javafx.fxml.FXMLLoader;
  6. import javafx.scene.Group;
  7. import javafx.scene.Parent;
  8. import javafx.scene.Scene;
  9. import javafx.scene.input.KeyEvent;
  10. import javafx.stage.Stage;
  11.  
  12. public class Main extends Application {
  13.  
  14.     @Override
  15.     public void start(Stage primaryStage) throws Exception{
  16.         Group root = new Group();
  17.         Pismenko p1 = new Pismenko(root.getScene(), root);
  18.         Pismenko p2 = new Pismenko(root.getScene(), root);
  19.  
  20.         root.getChildren().addAll(p1, p2);
  21.         root.requestFocus();
  22.         root.setOnKeyTyped(evt -> p1.handle(evt));
  23.         primaryStage.setTitle("Padajúce písmená");
  24.         primaryStage.setScene(new Scene(root, 600, 400));
  25.         primaryStage.setResizable(false);
  26.         primaryStage.show();
  27.     }
  28.  
  29.  
  30.     public static void main(String[] args) {
  31.         launch(args);
  32.     }
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement