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

The PopupMenu is not updated if the LAF is changed (incomplete fix of 4962731)

    XMLWordPrintable

Details

    • b10
    • x86
    • windows_xp
    • Verified

    Description

      FULL PRODUCT VERSION :
      java version "1.6.0-ea"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.6.0-ea-b43)
      Java HotSpot(TM) Client VM (build 1.6.0-ea-b43, mixed mode, sharing)

      A DESCRIPTION OF THE PROBLEM :
      There is a bug 4962731, which are supposed to be fixed in Mustang, but it is not. Look at the code:

      --- javax.swing.SwingUtilities
          private static void updateComponentTreeUI0(Component c) {
              if (c instanceof JComponent) {
                  JComponent jc = (JComponent) c;
                  jc.updateUI();
                  JPopupMenu jpm =jc.getComponentPopupMenu();
                  if(jpm != null && jpm.isVisible() && jpm.getInvoker() == jc) {
                      updateComponentTreeUI(jpm);
                  }
              }
      ...
      ---
      This 'if' condition ('jpm.isVisible() && jpm.getInvoker() == jc') just doesn't work if popup menu is not displayed (which are normal condition if LAF is changed by main menu).



      REPRODUCIBILITY :
      This bug can be reproduced always.

      CUSTOMER SUBMITTED WORKAROUND :
      override updateUI() and do manual update for component popup menu
      ###@###.### 2005-07-20 09:57:39 GMT

      Attachments

        Activity

          People

            alexp Alexander Potochkin (Inactive)
            jssunw Jitender S (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: