-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMenuPgm.java
More file actions
55 lines (53 loc) · 1.03 KB
/
MenuPgm.java
File metadata and controls
55 lines (53 loc) · 1.03 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
import java.awt.*;
import javax.swing.*;
import java.awt.event.*;
public class MenuPgm extends JFrame implements ActionListener
{
JFrame f;
JMenuBar mb;
JMenu m1,m2;
JMenuItem n1,n2,n3,n4;
public MenuPgm()
{
mb=new JMenuBar();
m1=new JMenu("Data Entry");
m2=new JMenu("Report");
n1=new JMenuItem("Inventory Master");
n2=new JMenuItem("Inventory Transaction");
n3=new JMenuItem("Exit");
n4=new JMenuItem("Inventory Report");
m1.add(n1); n1.addActionListener(this);
m1.add(n2); n2.addActionListener(this);
m1.addSeparator();
m1.add(n3); n3.addActionListener(this);
m2.add(n4); n4.addActionListener(this);
mb.add(m1); mb.add(m2);
this.setJMenuBar(mb);
setSize(500,500);
setVisible(true);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
}
public void actionPerformed(ActionEvent e)
{
if(e.getSource()==n1)
{
new Inventory();
}
if(e.getSource()==n2)
{
new InventoryTransaction();
}
if(e.getSource()==n3)
{
System.exit(0);
}
if(e.getSource()==n4)
{
new InventoryReport();
}
}
public static void main(String args[])
{
MenuPgm a1=new MenuPgm();
}
}