-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMainMenu.java
169 lines (143 loc) · 3.91 KB
/
MainMenu.java
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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class MainMenu extends JFrame implements ActionListener
{ JFrame jf;
JMenuBar mbar;
JMenu m1,m2,m3,m4,m5;
JMenuItem m1_1,m1_2,m1_3,m1_4,m1_5,m2_1,m2_2,m2_3,m2_4,m2_5,m3_1,m3_2,m4_1,m5_1;
JLabel l1,LogoColl;
GridBagLayout gbl;
public MainMenu()
{
jf=new JFrame();
gbl=new GridBagLayout();
jf.setLayout(gbl);
l1=new JLabel("WELCOME TO MEDICAL STOCK MANAGEMENT SYSTEM");
l1.setFont(new Font("Times New Roman",Font.BOLD,20));
jf.add(l1);
mbar = new JMenuBar();
jf.setJMenuBar(mbar);
m1=new JMenu("Supplier");
mbar.add(m1);
m1_1 = new JMenuItem("Add New Supplier",new ImageIcon("images//addnew.png"));
m1.add(m1_1);
m1_2 = new JMenuItem("search Supplier",new ImageIcon("images//search.png"));
m1.add(m1_2);
m1_3 = new JMenuItem("Update Supplier",new ImageIcon("images//update.png"));
m1.add(m1_3);
m1_4 = new JMenuItem("Delete Supplier",new ImageIcon("images//delete.png"));
m1.add(m1_4);
m1_5 = new JMenuItem("List of Supplier",new ImageIcon("images//all.png"));
m1.add(m1_5);
m2=new JMenu("Medicine");
mbar.add(m2);
m2_1 = new JMenuItem("Add New Medicine",new ImageIcon("images//addnew.png"));
m2.add(m2_1);
m2_2 = new JMenuItem("search Medicine",new ImageIcon("images//search.png"));
m2.add(m2_2);
m2_3 = new JMenuItem("Update Medicine",new ImageIcon("images//update.png"));
m2.add(m2_3);
m2_4 = new JMenuItem("Delete Medicine",new ImageIcon("images//delete.png"));
m2.add(m2_4);
m2_5 = new JMenuItem("Stock of Medicine",new ImageIcon("images//all.png"));
m2.add(m2_5);
m3=new JMenu("Report");
mbar.add(m3);
m3_1 = new JMenuItem("Daily Purchase Report",new ImageIcon("images//report.png"));
m3.add(m3_1);
m3_2 = new JMenuItem("Suplier wise medicine Report",new ImageIcon("images//report.png"));
m3.add(m3_2);
m4=new JMenu("About");
mbar.add(m4);
m4_1 = new JMenuItem("About System",new ImageIcon("images//help.png"));
m4.add(m4_1);
m5=new JMenu("Exit");
mbar.add(m5);
m5_1 = new JMenuItem("Exit",new ImageIcon("images//exit.png"));
m5.add(m5_1);
m1_1.addActionListener(this);
m1_2.addActionListener(this);
m1_3.addActionListener(this);
m1_4.addActionListener(this);
m1_5.addActionListener(this);
m2_1.addActionListener(this);
m2_2.addActionListener(this);
m2_3.addActionListener(this);
m2_4.addActionListener(this);
m2_5.addActionListener(this);
m3_1.addActionListener(this);
m3_2.addActionListener(this);
m4_1.addActionListener(this);
m5_1.addActionListener(this);
jf.setTitle("Main Menu");
jf.setLocation(20,20);
jf.setSize(900,700);
jf.setResizable(false);
jf.getContentPane().setBackground(Color.cyan);
jf.setVisible(true);
}
public void actionPerformed(ActionEvent ae)
{
if(ae.getSource()==m1_1)
{
new AddNewSupplier();
}
else if(ae.getSource()==m1_2)
{
new SearchSupplier();
}
else if(ae.getSource()==m1_3)
{
new UpdateSupplier();
}
else if(ae.getSource()==m1_4)
{
new DeleteSupplier();
}
else if(ae.getSource()==m1_5)
{
new SupplierList();
}
else if(ae.getSource()==m2_1)
{
new AddNewMedicine();
}
else if(ae.getSource()==m2_2)
{
new SearchMedicine();
}
else if(ae.getSource()==m2_3)
{
new UpdateMedicine();
}
else if(ae.getSource()==m2_4)
{
new DeleteMedicine();
}
else if(ae.getSource()==m2_5)
{
new MedicineList();
}
else if(ae.getSource()==m3_1)
{
new DailyPurchaseReport();
}
else if(ae.getSource()==m3_2)
{
new SupplierWiseMedList();
}
else if(ae.getSource()==m4_1)
{
new About();
}
else if(ae.getSource()==m5_1)
{
System.exit(0);
}
}
public static void main(String args[])
{
new MainMenu();
}
}