package example;
//-*- mode:java; encoding:utf-8 -*-
// vim:set fileencoding=utf-8:
//@homepage@
import java.awt.*;
import javax.swing.*;

public final class MainPanel extends JPanel {
    private MainPanel() {
        super(new BorderLayout());
        add(new JLabel(new ImageIcon(getClass().getResource("test.png"))));
        setPreferredSize(new Dimension(320, 240));
    }
    private static JMenuBar makeMenuBar() {
        JMenuBar mb = new JMenuBar();
        JMenu menu = new JMenu("File");
        mb.add(menu);
        menu.add(new JMenuItem("Open"));
        menu.add(new JMenuItem("Save"));
        menu.add(new JMenuItem("Close"));
        menu.add(new JMenuItem("Exit"));
        menu = new JMenu("Edit");
        mb.add(menu);
        menu.add(new JMenuItem("Cut"));
        menu.add(new JMenuItem("Copy"));
        menu.add(new JMenuItem("Paste"));
        JMenu smenu = new JMenu("Edit");
        smenu.add(new JMenuItem("Cut"));
        smenu.add(new JMenuItem("Copy"));
        smenu.add(new JMenuItem("Paste"));
        menu.add(smenu);
        return mb;
    }

    public static void main(String... args) {
        EventQueue.invokeLater(new Runnable() {
            @Override public void run() {
                createAndShowGUI();
            }
        });
    }
    public static void createAndShowGUI() {
        try {
            UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
        } catch (ClassNotFoundException | InstantiationException
               | IllegalAccessException | UnsupportedLookAndFeelException ex) {
            ex.printStackTrace();
        }
        UIManager.put("PopupMenuUI", "example.CustomPopupMenuUI");
        //contrib.com.jgoodies.looks.common.ShadowPopupFactory.install();

        JFrame frame = new JFrame("@title@");
        frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
        frame.setJMenuBar(makeMenuBar());
        frame.getContentPane().add(new MainPanel());
        frame.pack();
        frame.setLocationRelativeTo(null);
        frame.setVisible(true);
    }
}

@@ -537,30 +537,15 @@
 add(
-new JMenuItem(
 %22Open%22)
-)
 ;%0A  
@@ -563,30 +563,15 @@
 add(
-new JMenuItem(
 %22Save%22)
-)
 ;%0A  
@@ -589,30 +589,16 @@
 add(
-new JMenuItem(
 %22Close%22)
 );%0A 
@@ -593,17 +593,16 @@
 %22Close%22)
-)
 ;%0A      
@@ -616,30 +616,15 @@
 add(
-new JMenuItem(
 %22Exit%22)
-)
 ;%0A  
@@ -694,37 +694,22 @@
 enu.add(
-new JMenuItem(
 %22Cut%22)
-)
 ;%0A      
@@ -719,38 +719,23 @@
 enu.add(
-new JMenuItem(
 %22Copy%22)
-)
 ;%0A      
@@ -745,38 +745,24 @@
 enu.add(
-new JMenuItem(
 %22Paste%22)
 );%0A     
@@ -745,33 +745,32 @@
 enu.add(%22Paste%22)
-)
 ;%0A        JMenu 
@@ -818,29 +818,14 @@
 add(
-new JMenuItem(
 %22Cut%22)
-)
 ;%0A  
@@ -844,30 +844,15 @@
 add(
-new JMenuItem(
 %22Copy%22)
-)
 ;%0A  
@@ -871,30 +871,16 @@
 add(
-new JMenuItem(
 %22Paste%22)
 );%0A 
@@ -875,17 +875,16 @@
 %22Paste%22)
-)
 ;%0A      

use JMenu#add(String) instead of JMenu#add(new JMenuItem(String))