University stuff.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. import javafx.application.Application;
  2. import javafx.scene.Parent;
  3. import javafx.scene.Scene;
  4. import javafx.scene.layout.GridPane;
  5. import javafx.scene.control.Button;
  6. import javafx.event.ActionEvent;
  7. import javafx.stage.Stage;
  8. import javafx.event.EventHandler;
  9. class Lytter implements EventHandler<ActionEvent> {
  10. @Override
  11. public void handle(ActionEvent ae) {
  12. javafx.application.Platform.exit();
  13. }
  14. }
  15. public class GUI extends Application {
  16. @Override
  17. public void start(Stage win) throws Exception {
  18. GridPane root = new GridPane();
  19. Scene scene = new Scene(root, 900, 700);
  20. Button button = new Button("Si hei");
  21. Lytter knappelytter = new Lytter();
  22. button.setOnAction(knappelytter);
  23. root.getChildren().add(button);
  24. win.setScene(scene);
  25. win.show();
  26. win.setTitle("et vindu!");
  27. }
  28. public static void main(String[] args) {
  29. launch(args);
  30. }
  31. public GUI() {
  32. super();
  33. }
  34. }