- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMenu.java
More file actions
Latest commit
86 lines (78 loc) · 2.36 KB
/
Copy pathMenu.java
File metadata and controls
86 lines (78 loc) · 2.36 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
78
79
80
81
82
83
84
85
86
importjava.awt.BorderLayout;
importjava.awt.EventQueue;
importjavax.swing.JFrame;
importjavax.swing.JPanel;
importjavax.swing.border.EmptyBorder;
importjavax.swing.JMenuBar;
importjavax.swing.JButton;
importjava.awt.event.ActionListener;
importjava.sql.SQLException;
importjava.awt.event.ActionEvent;
publicclassMenuextendsJFrame {
/**
*
*/
privatestaticfinallongserialVersionUID = 1L;
privateJPanelcontentPane;
/**
* Launch the application.
*/
publicstaticvoidmain(String[] args) {
EventQueue.invokeLater(newRunnable() {
publicvoidrun() {
try {
Menuframe = newMenu();
frame.setVisible(true);
} catch (Exceptione) {
e.printStackTrace();
}
}
});
}
/**
* Create the frame.
*/
publicMenu() {
ActionListenera1=newActionListener(){
publicvoidactionPerformed(ActionEventae)
{
newaccount_form().setVisible(true); //create the account form and make it visible
};
};
ActionListenera2=newActionListener(){
publicvoidactionPerformed(ActionEventae)
{
try {
newcus_query().setVisible(true); //create the customer query and make it visisble
} catch (SQLExceptione) {
// TODO Auto-generated catch block
e.printStackTrace();
}
};
};
ActionListenera3=newActionListener(){
publicvoidactionPerformed(ActionEventae)
{
newAccount_deposit_form().setVisible(true); //create the account form and make it visible
};
};
JMenuBarmenuBar = newJMenuBar();
setJMenuBar(menuBar);
setTitle("Master Menu");
JButtonbutton = newJButton("Account Form");
button.addActionListener(a1);
menuBar.add(button);
JButtonbtnNewButton = newJButton("Customer Query Form");
menuBar.add(btnNewButton);
btnNewButton.addActionListener(a2);
JButtonbtnNewButton_1 = newJButton("Account Deposit Form");
btnNewButton_1.addActionListener(a3);
menuBar.add(btnNewButton_1);
setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
setBounds(100, 100, 450, 300);
contentPane = newJPanel();
contentPane.setBorder(newEmptyBorder(5, 5, 5, 5));
contentPane.setLayout(newBorderLayout(0, 0));
setContentPane(contentPane);
}
}