|
@@ -1,5 +1,12 @@
|
1
|
1
|
package rocks.zipcode.atm;
|
2
|
2
|
|
|
3
|
+import javafx.event.ActionEvent;
|
|
4
|
+import javafx.event.EventHandler;
|
|
5
|
+import javafx.geometry.Insets;
|
|
6
|
+import javafx.geometry.Pos;
|
|
7
|
+import javafx.scene.control.Label;
|
|
8
|
+import javafx.scene.layout.GridPane;
|
|
9
|
+import javafx.scene.layout.StackPane;
|
3
|
10
|
import rocks.zipcode.atm.bank.Bank;
|
4
|
11
|
import javafx.application.Application;
|
5
|
12
|
import javafx.scene.Parent;
|
|
@@ -15,11 +22,40 @@ import javafx.scene.layout.FlowPane;
|
15
|
22
|
* @author ZipCodeWilmington
|
16
|
23
|
*/
|
17
|
24
|
public class CashMachineApp extends Application {
|
18
|
|
-
|
|
25
|
+ private Stage window;
|
|
26
|
+ Scene mainContent, loginScene;
|
19
|
27
|
private TextField field = new TextField();
|
20
|
28
|
private CashMachine cashMachine = new CashMachine(new Bank());
|
21
|
29
|
|
22
|
|
- private Parent createContent() {
|
|
30
|
+ @Override
|
|
31
|
+ public void start(Stage stage) throws Exception {
|
|
32
|
+ window = stage;
|
|
33
|
+ window.setTitle("Zip Cloud Bank");
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+ //Log In Layout
|
|
37
|
+ Label loginLabel = new Label("Welcome to Zip Cloud Bank!\nPlease log in.");
|
|
38
|
+ Button btnLogIn = new Button("Log In");
|
|
39
|
+ btnLogIn.setStyle("-fx-font-size: 15pt");
|
|
40
|
+ btnLogIn.setOnAction(e -> {
|
|
41
|
+ mainContent = new Scene(mainContent());
|
|
42
|
+ window.setScene(mainContent);
|
|
43
|
+ });
|
|
44
|
+
|
|
45
|
+ GridPane loginLayout = new GridPane();
|
|
46
|
+ loginLayout.setHgap(12);
|
|
47
|
+ loginLayout.setVgap(12);
|
|
48
|
+ loginLayout.setAlignment(Pos.CENTER);
|
|
49
|
+ loginLayout.getChildren().addAll(loginLabel, field, btnLogIn);
|
|
50
|
+
|
|
51
|
+ loginScene = new Scene(loginLayout,600, 600);
|
|
52
|
+ window.setScene(loginScene);
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+ window.show();
|
|
56
|
+ }
|
|
57
|
+
|
|
58
|
+ private Parent mainContent() {
|
23
|
59
|
VBox vbox = new VBox(10);
|
24
|
60
|
vbox.setPrefSize(600, 600);
|
25
|
61
|
|
|
@@ -66,12 +102,6 @@ public class CashMachineApp extends Application {
|
66
|
102
|
return vbox;
|
67
|
103
|
}
|
68
|
104
|
|
69
|
|
- @Override
|
70
|
|
- public void start(Stage stage) throws Exception {
|
71
|
|
- stage.setScene(new Scene(createContent()));
|
72
|
|
- stage.show();
|
73
|
|
- }
|
74
|
|
-
|
75
|
105
|
public static void main(String[] args) {
|
76
|
106
|
launch(args);
|
77
|
107
|
}
|