Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4172190

Submenus do not open using JPopupMenu.setDefaultLightWeightPopupEnabled(false);

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P4 P4
    • None
    • 1.1.6
    • client-libs



      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)
      ======================================================================

            gsaab Georges Saab
            dindrigo Daniel Indrigo (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: