|
@@ -30,16 +30,11 @@ public class CashMachineApp extends Application {
|
30
|
30
|
|
31
|
31
|
TextArea areaInfo = new TextArea();
|
32
|
32
|
|
33
|
|
- Button btnSubmit = new Button("Enter");
|
34
|
|
- btnSubmit.setOnAction(e -> {
|
35
|
|
- int id = Integer.parseInt(field.getText());
|
36
|
|
- cashMachine.login(id);
|
37
|
33
|
|
38
|
|
- areaInfo.setText(cashMachine.toString());
|
39
|
|
- });
|
40
|
34
|
|
41
|
35
|
//Make Button Do something.
|
42
|
36
|
Button btnNewAccount = new Button("Setup New Account");
|
|
37
|
+ btnNewAccount.setDisable(true);
|
43
|
38
|
/*
|
44
|
39
|
btnSubmit.setOnAction(e -> {
|
45
|
40
|
|
|
@@ -47,6 +42,7 @@ public class CashMachineApp extends Application {
|
47
|
42
|
*/
|
48
|
43
|
|
49
|
44
|
Button btnDeposit = new Button("Deposit");
|
|
45
|
+ btnDeposit.setDisable(true);
|
50
|
46
|
btnDeposit.setOnAction(e -> {
|
51
|
47
|
float amount = Float.parseFloat(field2.getText());
|
52
|
48
|
cashMachine.deposit(amount);
|
|
@@ -54,7 +50,9 @@ public class CashMachineApp extends Application {
|
54
|
50
|
areaInfo.setText(cashMachine.toString());
|
55
|
51
|
});
|
56
|
52
|
|
|
53
|
+
|
57
|
54
|
Button btnWithdraw = new Button("Withdraw");
|
|
55
|
+ btnWithdraw.setDisable(true);
|
58
|
56
|
btnWithdraw.setOnAction(e -> {
|
59
|
57
|
float amount = Float.parseFloat(field2.getText());
|
60
|
58
|
cashMachine.withdraw(amount);
|
|
@@ -68,6 +66,18 @@ public class CashMachineApp extends Application {
|
68
|
66
|
field.clear();
|
69
|
67
|
field2.clear();
|
70
|
68
|
areaInfo.clear();
|
|
69
|
+ btnDeposit.setDisable(true);
|
|
70
|
+ btnWithdraw.setDisable(true);
|
|
71
|
+ });
|
|
72
|
+
|
|
73
|
+ Button btnSubmit = new Button("Enter");
|
|
74
|
+ btnSubmit.setOnAction(e -> {
|
|
75
|
+ int id = Integer.parseInt(field.getText());
|
|
76
|
+ cashMachine.login(id);
|
|
77
|
+
|
|
78
|
+ areaInfo.setText(cashMachine.toString());
|
|
79
|
+ btnDeposit.setDisable(false);
|
|
80
|
+ btnWithdraw.setDisable(false);
|
71
|
81
|
});
|
72
|
82
|
|
73
|
83
|
FlowPane flowpane = new FlowPane();
|