import javafx.application.Application; import javafx.event.*; import javafx.scene.Scene; import javafx.scene.control.*; import javafx.stage.Stage; public class Poomine1 extends Application implements EventHandler{ Button nupp1=new Button("Sisesta"); public void handle(ActionEvent e){ System.out.println("vajutati nuppu"); } public void start(Stage aken){ Scene stseen=new Scene(nupp1, 400, 300); nupp1.setOnAction(this); aken.setScene(stseen); aken.setTitle("Poomismäng"); aken.show(); } public static void main(String[] arg){ launch(arg); } }