Advertisement
Guest User

Untitled

a guest
Mar 16th, 2019
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.05 KB | None | 0 0
  1. public class Login extends Application {
  2.  
  3. @Override
  4. public void start(Stage primaryStage) {
  5. GridPane grid = new GridPane();
  6. grid.setAlignment(Pos.CENTER);
  7. grid.setHgap(10);
  8. grid.setVgap(10);
  9. grid.setPadding(new Insets(25, 25, 25, 25));
  10.  
  11. Text sceneTitle = new Text("Welcome");
  12. sceneTitle.setFont(Font.font("Tahoma", FontWeight.NORMAL, 20));
  13. grid.add(sceneTitle, 0, 0, 2, 1);
  14.  
  15. Label userName = new Label("User Name:");
  16. grid.add(userName, 0, 1);
  17.  
  18. Label pw = new Label("Password:");
  19. grid.add(pw, 0, 2);
  20.  
  21.  
  22. Scene scene = new Scene(grid, 300, 275);
  23. primaryStage.setScene(scene);
  24.  
  25. primaryStage.setTitle("JavaFX Welcome");
  26. primaryStage.show();
  27. }
  28.  
  29. /**
  30. * The main() method is ignored in correctly deployed JavaFX application.
  31. * main() serves only as fallback in case the application can not be
  32. * launched through deployment artifacts, e.g., in IDEs with limited FX
  33. * support. NetBeans ignores main().
  34. *
  35. * @param args the command line arguments
  36. */
  37. public static void main(String[] args) {
  38. launch(args);
  39. }
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement