Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import javafx.geometry.Pos;
- import javafx.scene.Scene;
- import javafx.scene.control.Button;
- import javafx.scene.control.Label;
- import javafx.scene.layout.VBox;
- import javafx.stage.Modality;
- import javafx.stage.Stage;
- public class AlertPopupC {
- public static void popup(String title, String message){
- Stage window = new Stage();
- window.setMinWidth(250);
- window.setTitle(title);
- window.initModality(Modality.APPLICATION_MODAL);
- Label label = new Label();
- label.setText("Jebem majke kolko sam lep :3");
- Button button = new Button("zatvori me");
- button.setOnAction(e -> window.close());
- VBox layout = new VBox(10);
- layout.getChildren().addAll(label,button);
- layout.setAlignment(Pos.CENTER);
- Scene scena = new Scene(layout);
- window.setScene(scena);
- window.showAndWait();
- }
- }
Add Comment
Please, Sign In to add comment