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

HeavyWeight JPopupMenu not selectable when focusable

XMLWordPrintable

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

      FULL PRODUCT VERSION :
      j2re 1.5.0_04 Plugin only

      ADDITIONAL OS VERSION INFORMATION :
      Windows 2000 / XP

      A DESCRIPTION OF THE PROBLEM :
      I have created a JPopupMenu with a title component (JPanel containing JLabel and glue) and some JMenuItems.
      When I open the JPopupMenu inside the Applet (WNetscapeEmbeddedFrame) everything works fine, but when the JPopupMenu leaves the browser (HeavyWeightPopup), I can not select any JMenuItems any more.
      Reason:
      Class PopupFactory, inner class HeavyWeightPopup:
      if one of the components inside the JPopupMenu is not a JSeparator or a JMenuItem, then the window of the HeavyWeightPopup is set to be focusable.
      When I click on one of the JMenuItems, the AppletFrame looses focus and cancels the HeavyWeightPopup (method windowDeactivated in BasicPopupMenuUI / MouseGrabber. The Items are not selectable

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Create a JPopupMenu with a JLabel as first Item and a JMenuItem as second item, open it, making the JPopupMenu leave the browser to become heavyWeight, then click on the JMenuItem: JPopup disappears without firing actionPerformed in JMenuItem
      Note: eventDispatched(AWTEvent) in MouseGrabber does not get fired as well.

      NOTE: This only happens inside an Applet (IE 6 / Mozilla 1.0). It works fine in an application or in an AppletViewer.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      I expect the JMenuItems to fire in LightWeight and HeavyWeight popups, as they did in 1.4
      ACTUAL -
      Nothing happended

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      Any ordinary JPopupMenu with a JLabel as first Item and JMenuItem as second Item will do, as long as the JPopupMenu leaves the Applet.
      ---------- END SOURCE ----------

      CUSTOMER SUBMITTED WORKAROUND :
      Create a JMenuItem for the title component that behaves like a JLabel (disabled, No action, not disabled foreground)

            draskinsunw Daniel Raskin (Inactive)
            jssunw Jitender S (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: