|
@@ -1,5 +1,14 @@
|
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.HBox;
|
|
10
|
+import javafx.scene.paint.Color;
|
|
11
|
+import javafx.scene.text.Text;
|
3
|
12
|
import rocks.zipcode.atm.bank.Bank;
|
4
|
13
|
import javafx.application.Application;
|
5
|
14
|
import javafx.scene.Parent;
|
|
@@ -19,6 +28,40 @@ public class CashMachineApp extends Application {
|
19
|
28
|
private TextField field = new TextField();
|
20
|
29
|
private CashMachine cashMachine = new CashMachine(new Bank());
|
21
|
30
|
|
|
31
|
+ public void login(Stage primaryStage){
|
|
32
|
+ GridPane grid = new GridPane();
|
|
33
|
+ grid.setAlignment(Pos.CENTER);
|
|
34
|
+ grid.setHgap(10);
|
|
35
|
+ grid.setVgap(10);
|
|
36
|
+ grid.setPadding(new Insets(25, 25, 25, 25));
|
|
37
|
+
|
|
38
|
+ Button btn = new Button("Log in");
|
|
39
|
+ HBox hbButton = new HBox(10);
|
|
40
|
+ hbButton.setAlignment(Pos.BOTTOM_RIGHT);
|
|
41
|
+ hbButton.getChildren().add(btn);
|
|
42
|
+ grid.add(hbButton,1,4);
|
|
43
|
+
|
|
44
|
+ final Text actiontarget = new Text();
|
|
45
|
+ grid.add(actiontarget,1,6);
|
|
46
|
+
|
|
47
|
+ btn.setOnAction(new EventHandler<ActionEvent>() {
|
|
48
|
+ @Override
|
|
49
|
+ public void handle(ActionEvent event) {
|
|
50
|
+ createContent();
|
|
51
|
+
|
|
52
|
+ }
|
|
53
|
+ });
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+ Scene scene = new Scene(grid, 300, 275);
|
|
57
|
+ primaryStage.setScene(scene);
|
|
58
|
+ primaryStage.setTitle("Welcome to Zip Cloud Bank");
|
|
59
|
+ Label userID = new Label("User I.D.");
|
|
60
|
+ grid.add(userID,0,1);
|
|
61
|
+ TextField userTextField = new TextField();
|
|
62
|
+ grid.add(userTextField,1,1);
|
|
63
|
+ }
|
|
64
|
+
|
22
|
65
|
private Parent createContent() {
|
23
|
66
|
VBox vbox = new VBox(10);
|
24
|
67
|
vbox.setPrefSize(600, 600);
|