Skip to content

Instantly share code, notes, and snippets.

@ahn94
Created July 11, 2015 22:06
Show Gist options
  • Save ahn94/be1829f9da69ca46dd30 to your computer and use it in GitHub Desktop.
Save ahn94/be1829f9da69ca46dd30 to your computer and use it in GitHub Desktop.
GridPane grid = new GridPane();
grid.setPadding(new Insets(10, 10, 10, 10));
grid.setVgap(8);
grid.setHgap(10);
Label username = new Label("Username");
GridPane.setConstraints(username, 0, 0);
//Name input
TextField nameInput = new TextField();
GridPane.setConstraints(nameInput, 1, 0);
nameInput.setPromptText("Name here");
//password label
Label password = new Label("Password");
GridPane.setConstraints(password, 0, 1);
//Password input
TextField passInput = new TextField();
GridPane.setConstraints(passInput, 1, 1);
passInput.setPromptText("Password here");
Button loginButton = new Button("Log In");
GridPane.setConstraints(loginButton, 1, 2);
grid.getChildren().addAll(username, nameInput, passInput, password, loginButton);
Scene scene = new Scene(grid, 250, 120);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment