Skip to content

Commit b0a9e44

Browse files
committed
Updated
1 parent c986ab4 commit b0a9e44

24 files changed

Lines changed: 153 additions & 1326 deletions

File tree

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
package buckysCode;
2+
import javafx.application.Application;
3+
import javafx.geometry.Insets;
4+
import javafx.scene.Scene;
5+
import javafx.scene.control.Button;
6+
import javafx.scene.control.Label;
7+
import javafx.scene.control.TextField;
8+
import javafx.scene.layout.GridPane;
9+
import javafx.stage.Stage;
10+
11+
public class GridPaneExample extends Application {
12+
13+
Stage window;
14+
15+
public static void main(String[] args) {
16+
launch(args);
17+
}
18+
19+
@Override
20+
public void start(Stage primaryStage) throws Exception {
21+
window = primaryStage;
22+
window.setTitle("thenewboston - JavaFX");
23+
24+
//GridPane with 10px padding around edge
25+
GridPane grid = new GridPane();
26+
grid.setPadding(new Insets(10, 10, 10, 10));
27+
grid.setVgap(8);
28+
grid.setHgap(10);
29+
30+
//Name Label - constrains use (child, column, row)
31+
Label nameLabel = new Label("Username:");
32+
GridPane.setConstraints(nameLabel, 0, 0);
33+
34+
//Name Input
35+
TextField nameInput = new TextField("Bucky");
36+
GridPane.setConstraints(nameInput, 1, 0);
37+
38+
//Password Label
39+
Label passLabel = new Label("Password:");
40+
GridPane.setConstraints(passLabel, 0, 1);
41+
42+
//Password Input
43+
TextField passInput = new TextField();
44+
passInput.setPromptText("password");
45+
GridPane.setConstraints(passInput, 1, 1);
46+
47+
//Login
48+
Button loginButton = new Button("Log In");
49+
GridPane.setConstraints(loginButton, 1, 2);
50+
51+
//Add everything to grid
52+
grid.getChildren().addAll(nameLabel, nameInput, passLabel, passInput, loginButton);
53+
54+
Scene scene = new Scene(grid, 300, 200);
55+
window.setScene(scene);
56+
window.show();
57+
}
58+
59+
60+
}

‎JavaFX Practice/src/databaseapp/Index.fxml‎

Lines changed: 0 additions & 231 deletions
This file was deleted.

‎JavaFX Practice/src/databaseapp/IndexController.java‎

Lines changed: 0 additions & 13 deletions
This file was deleted.

0 commit comments

Comments
 (0)