package sample; import javafx.application.Application; import javafx.event.ActionEvent; import javafx.event.EventHandler; import javafx.scene.control.Button; import javafx.scene.layout.StackPane; import javafx.fxml.FXMLLoader; import javafx.scene.Parent; import javafx.scene.Scene; import javafx.stage.Stage; public class Main extends Application{ Button button; @Override public void start(Stage primaryStage) throws Exception{ primaryStage.setTitle("Title of the Window"); button = new Button(); button.setText("Click me"); button.setOnAction(e -> { System.out.println("hey now brown cow"); System.out.println("PokemonGo"); }); StackPane layout = new StackPane(); layout.getChildren().add(button); Scene scene = new Scene(layout, 300, 250); primaryStage.setScene(scene); primaryStage.show(); } public static void main(String[] args) { launch(args); } }