import javafx.application.Application; import javafx.stage.Stage; import javafx.scene.Scene; import javafx.scene.layout.VBox; import javafx.scene.control.Button; import javafx.scene.control.Label; public class App extends Application { public static void main(String[] args) { launch(args); } @Override public void start(Stage primaryStage) { Label label1 = new Label("Első"); Button button1 = new Button("Másik"); VBox vbox1 = new VBox(); vbox1.getChildren().addAll(label1, button1); Scene scene1 = new Scene(vbox1, 300, 250); button1.setOnAction(e -> MsgBox.show("cím", "Valami")); primaryStage.setScene(scene1); primaryStage.show(); } }