fr1sk

Untitled

May 22nd, 2017
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. import javafx.geometry.Pos;
  2. import javafx.scene.Scene;
  3. import javafx.scene.control.Button;
  4. import javafx.scene.control.Label;
  5. import javafx.scene.layout.VBox;
  6. import javafx.stage.Modality;
  7. import javafx.stage.Stage;
  8.  
  9. public class AlertPopupC {
  10. public static void popup(String title, String message){
  11. Stage window = new Stage();
  12. window.setMinWidth(250);
  13. window.setTitle(title);
  14. window.initModality(Modality.APPLICATION_MODAL);
  15.  
  16. Label label = new Label();
  17. label.setText("Jebem majke kolko sam lep :3");
  18.  
  19. Button button = new Button("zatvori me");
  20. button.setOnAction(e -> window.close());
  21.  
  22. VBox layout = new VBox(10);
  23. layout.getChildren().addAll(label,button);
  24. layout.setAlignment(Pos.CENTER);
  25.  
  26. Scene scena = new Scene(layout);
  27. window.setScene(scena);
  28. window.showAndWait();
  29. }
  30. }
Add Comment
Please, Sign In to add comment