Advertisement
Guest User

Untitled

a guest
Jul 21st, 2017
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.86 KB | None | 0 0
  1. Stage loginDialog = new LoginDialog(stage);
  2. loginDialog.sizeToScene();
  3. loginDialog.showAndWait();
  4.  
  5. /* do the login */
  6. close();
  7. /* need to return thew user id to the main form*/
  8.  
  9. public class DialogBox {
  10. private static String[] login;
  11.  
  12. public static String[] display(String title, String message) {
  13. Stage window = new Stage();
  14. window.initModality(Modality.APPLICATION_MODAL);
  15. window.setTitle(title);
  16. window.setWidth(300);
  17. window.setHeight(175);
  18. window.initStyle(StageStyle.UTILITY);
  19. Label label = new Label(message);
  20.  
  21. //Set up the JavaFX button controls and listeners and the text fields for the login info. The button listeners set the login values
  22.  
  23. window.setScene(new Scene(root, 300, 175);
  24. window.showAndWait();
  25. return login;
  26. }
  27.  
  28. String[] login = DialogBox.display("Login Dialog", "Enter User Name and Password");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement