No change
OK, here is construction of the JFrame
public void runBankSystem()
{
Dimension d = new Dimension(500, 500);
setTitle("Bank Managment System");
setSize(d);
setLocation(rp.resultPosition(d));
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setMenuBar();
setJMenuBar(jmb);
getContentPane().add(mainPanel);
setVisible(true);
}
and here is JMenuBar to call the changes
public void setMenuBar()
{
jmb = new JMenuBar();
JMenu jmEmployee = new JMenu("Employee");
JMenuItem jmiAddEmployee = new JMenuItem("Add Employee");
jmiAddEmployee.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent ae)
{
mainPanel.removeAll();
mainPanel.add(addEP);
validate();
}
});
JMenuItem jmiEditEmployee = new JMenuItem("Edit Employee");
jmiEditEmployee.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent ae)
{
mainPanel.removeAll();
mainPanel.add(editEP);
validate();
}
});
jmiEditEmployee.addActionListener(this);
jmEmployee.add(jmiAddEmployee);
jmEmployee.add(jmiEditEmployee);
jmb.add(jmEmployee);
JMenu jmClient = new JMenu("Client");
JMenuItem jmiAllClients = new JMenuItem("All Customers");
jmiAllClients.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent ae)
{
mainPanel.removeAll();
mainPanel.add(allCP);
validate();
}
});
jmiAllClients.addActionListener(this);
jmClient.add(jmiAllClients);
jmb.add(jmClient);
JMenu jmLogout = new JMenu("Logout");
jmLogout.addActionListener(this);
jmb.add(jmLogout);
}