import javafx.application.Application; import javafx.event.*; import javafx.scene.Scene; import javafx.scene.control.*; import javafx.scene.layout.*; import javafx.stage.Stage; public class Poomine2 extends Application implements EventHandler{ Button nupp1=new Button("Sisesta"); TextField tf1=new TextField(); Label vastus=new Label("vastuse koht"); public void handle(ActionEvent e){ vastus.setText(tf1.getText()); } public void start(Stage aken){ HBox paneel1=new HBox(10); paneel1.getChildren().add(tf1); paneel1.getChildren().add(nupp1); VBox paneel2=new VBox(); paneel2.getChildren().addAll(paneel1, vastus); Scene stseen=new Scene(paneel2, 400, 300); nupp1.setOnAction(this); aken.setScene(stseen); aken.setTitle("Poomismäng"); aken.show(); } public static void main(String[] arg){ launch(arg); } }