import javafx.application.Application; import javafx.geometry.Insets; import javafx.stage.Stage; import javafx.scene.Scene; import javafx.scene.control.Button; import javafx.scene.control.Alert; import javafx.scene.layout.VBox; public class App extends Application { public static void main(String[] args) { launch(args); } @Override public void start(Stage primaryStage) throws Exception { Button showButton = new Button("Mutat"); Alert alert = new Alert(Alert.AlertType.INFORMATION); showButton.setOnAction(e -> { alert.setTitle("Címsor szöveg"); alert.setHeaderText("Fejrész szöveg"); alert.setContentText("Üzenet"); alert.showAndWait(); }); VBox vbox = new VBox(); vbox.setPadding(new Insets(10, 10, 10, 10)); vbox.setSpacing(10); vbox.getChildren().add(showButton); Scene scene = new Scene(vbox, 300, 250); primaryStage.setScene(scene); primaryStage.show(); } }