Duplicate :
|
Name: diC59631 Date: 09/09/98 In swing11.beta2: When building JMenuBar with a File menu that contains submenus, the submenus do not open when clicking on them, if JPopupMenu.setDefaultLightWeightPopupEnabled(false); is used. This is the example code: public class MenTest extends java.lang.Object { public static void main(String args[]) { JPopupMenu.setDefaultLightWeightPopupEnabled(false); JFrame frame = new JFrame(); frame.setSize(300, 300); JPanel pan = new JPanel(); pan.setLayout(new BorderLayout()); JMenuBar mb = new JMenuBar(); pan.add(mb, BorderLayout.NORTH); JMenu file = new JMenu("File"); mb.add(file); JMenu neww = new JMenu("New"); file.add(neww); JMenu open = new JMenu("Open"); file.add(open); JMenuItem create = new JMenuItem("Create"); neww.add(create); JMenuItem browse = new JMenuItem("Browse"); open.add(browse); frame.getContentPane().add(pan); frame.show(); } } (Review ID: 38531) ======================================================================