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

REGRESSION: Heavy weight Popups are broken with custom PopupFactory in a sandbox environment

    XMLWordPrintable

Details

    • 6
    • x86
    • linux

    Description

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


      ADDITIONAL OS VERSION INFORMATION :
      Linux blade 2.6.13-02 #2 Fri Sep 2 11:43:56 Local time zone must be set--see zic manua i686 Mobile Intel(R) Pentium(R) 4 - M CPU 1.90GHz GenuineIntel GNU/Linux


      A DESCRIPTION OF THE PROBLEM :
      When I create a subclass of PopupFactory and _override_ #getPopup(Component,
      Component, int, int) of PopupFactory and use this subclass in a sandbox
      environment, then the heavy weight Popups are not shown properly.
      Medium weight and light weight Popups are shown without a problem.
      When I do not override the #getPopup-method, everything seems to work fine.
      This problem is not reproducible on Windows.


      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      1) compile the test case.

      2) run the test case with following command:

          java -Djava.security.manager Test

      3) when the window is visible, move the mouse cursor
           over the button to display the tooltip.


      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      A nice tooltip.
      ACTUAL -
      An empty window with no content. The window height grows when the heavy weight
      Popup is displayed again.

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      import java.awt.Component;

      import javax.swing.JButton;
      import javax.swing.JFrame;
      import javax.swing.Popup;
      import javax.swing.PopupFactory;

      /**
       * @author Andrej Golovnin
       * @version $Revision$
       */
      public class Test {

          public static void main(String[] args) {
              PopupFactory.setSharedInstance(new MyPopupFactory());
              JFrame frame = new JFrame("Test");
              frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              JButton button = new JButton("Test");
              button.setToolTipText("A very very very very very long tooltip.");
              frame.getContentPane().add(button);
              frame.pack();
              frame.setLocationRelativeTo(null);
              frame.setVisible(true);
          }

      }

      class MyPopupFactory extends PopupFactory {

          public Popup getPopup(Component owner, Component contents, int x, int y) throws IllegalArgumentException {
              return super.getPopup(owner, contents, x, y);
          }
          
      }

      ---------- END SOURCE ----------

      Release Regression From : mustang
      The above release value was the last known release where this
      bug was known to work. Since then there has been a regression.

      Attachments

        Issue Links

          Activity

            People

              yan Yuri Nesterenko
              rmandalasunw Ranjith Mandala (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: