After rearranging and slight modification of your code, here now
is your runnable code
import javax.swing.*;import java.awt.*;import java.awt.event.*;
public class FinalMenu extends JFrame
{ public FinalMenu()
{ Container contentPane = getContentPane();
JMenuBar mb = new JMenuBar();
JMenu master = new JMenu("Master");
JMenuItem exitItem = new JMenuItem("Exit");
JMenuItem general,employee,item,model;
master.add(general = new JMenuItem("General"));
master.add(employee = new JMenuItem("Employee"));
master.addSeparator();
master.add(item = new JMenuItem("Item"));
master.add(model = new JMenuItem("Model"));
master.addSeparator();
master.add(exitItem);
MyMenuHandler handler = new MyMenuHandler(this);
general.addActionListener(handler);
employee.addActionListener(handler);
item.addActionListener(handler);
model.addActionListener(handler);
MyWindowAdapter adapter = new MyWindowAdapter(this);
addWindowListener(adapter);
KeyStroke ks = KeyStroke.getKeyStroke
(KeyEvent.VK_X,Event.ALT_MASK);
exitItem.setAccelerator(ks);
master.setMnemonic('M');
exitItem.setMnemonic(KeyEvent.VK_X);
mb.add(master); setJMenuBar(mb); }
public static void main(String args[])
{ Frame f = new FinalMenu();
f.setVisible(true); } }
class MyWindowAdapter extends WindowAdapter
{ FinalMenu mnuFrame;
public MyWindowAdapter(FinalMenu mnuFrame)
{ this.mnuFrame = mnuFrame; }
public void windowClosing(WindowEvent we)
{ System.exit(0); } }
class MyMenuHandler implements ActionListener, ItemListener
{ FinalMenu mnuFrame;
public MyMenuHandler(FinalMenu mnuFrame)
{ this.mnuFrame = mnuFrame; }
public void actionPerformed(ActionEvent ae)
{ String arg = (String)ae.getActionCommand();
if (arg.equals("General"))
System.out.println("Want to call the general Master Form"); }
public void itemStateChanged(ItemEvent ie)
{ mnuFrame.repaint(); } }