Repository navigation
Expand file tree
/
Copy pathmain4.java
More file actions
77 lines (58 loc) · 2.04 KB
/
Copy pathmain4.java
File metadata and controls
77 lines (58 loc) · 2.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
import javafx.application.Application;
import javafx.geometry.Insets;
import javafx.scene.control.Button;
import javafx.event.ActionEvent;
import javafx.event.EventHandler;
import javafx.scene.Scene;
import javafx.scene.layout.StackPane;
import javafx.scene.layout.VBox;
import javafx.stage.Stage;
/**
* Created by Dynee on 6/2/16.
*/
public class main4 extends Application{
Button depositButton;
Button withdrawButton;
Button checkBalanceButton;
// create an account object for testing
Account a = new Account(1, "Lucas Padden", 8024, 100.0);
public static void main(String[] args) {
launch(args);
}
@Override
public void start(Stage primaryStage) throws Exception {
primaryStage.setTitle("ATM Application");
depositButton = new Button();
depositButton.setText("Deposit");
withdrawButton = new Button();
withdrawButton.setText("Withdraw");
checkBalanceButton = new Button();
checkBalanceButton.setText("Check Balance");
// can use other things than layouts to add your buttons too
// there are custom made layouts like vbox and hbox
// create a VBox to add the buttons in a column
VBox vb = new VBox();
vb.setPadding(new Insets(10));
vb.setSpacing(10);
vb.getChildren().addAll(depositButton, withdrawButton, checkBalanceButton);
Scene scene = new Scene(vb, 500, 500);
primaryStage.setScene(scene);
primaryStage.show();
// create a new window for deposit button.
depositButton.setOnAction(new EventHandler<ActionEvent>() {
@Override
public void handle(ActionEvent event) {
}
});
withdrawButton.setOnAction(new EventHandler<ActionEvent>() {
@Override
public void handle(ActionEvent event) {
}
});
checkBalanceButton.setOnAction(new EventHandler<ActionEvent>() {
@Override
public void handle(ActionEvent event) {
}
});
}
}