@@ -0,0 +1,1381 @@
+package com.dw.notepad2;%0Aimport java.awt.*;%0Aimport java.awt.event.*;%0Aimport javax.swing.*;%0Aimport javax.swing.event.*;%0A%0Apublic class JMenuTest %7B%0A%0A    public JMenuTest() %7B%0A%0A        JMenu menu = new JMenu(%22Menu%22);%0A        menu.setMnemonic(KeyEvent.VK_M);%0A        menu.addMenuListener(new SampleMenuListener());%0A        JMenu menu1 = new JMenu(%22Tool%22);%0A        menu1.setMnemonic(KeyEvent.VK_T);%0A        menu1.addMenuListener(new SampleMenuListener());%0A        JFrame f = new JFrame(%22ActionExample%22);%0A        JMenuBar mb = new JMenuBar();%0A        mb.add(menu);%0A        mb.add(menu1);%0A        f.setJMenuBar(mb);%0A        f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);%0A        f.pack();%0A        f.setLocationRelativeTo(null);%0A        f.setVisible(true);%0A    %7D%0A%0A    public static void main(String%5B%5D args) %7B%0A        EventQueue.invokeLater(new Runnable() %7B%0A%0A            @Override%0A            public void run() %7B%0A            %09JMenuTest actionExample = new JMenuTest();%0A            %7D%0A        %7D);%0A    %7D%0A%7D%0A%0Aclass SampleMenuListener implements MenuListener %7B%0A%0A    @Override%0A    public void menuSelected(MenuEvent e) %7B%0A        System.out.println(%22menuSelected%22);%0A    %7D%0A%0A    @Override%0A    public void menuDeselected(MenuEvent e) %7B%0A        System.out.println(%22menuDeselected%22);%0A    %7D%0A%0A    @Override%0A    public void menuCanceled(MenuEvent e) %7B%0A        System.out.println(%22menuCanceled%22);%0A    %7D%0A%7D%0A%0A

add JMenu Testing