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

Several swing components behave incorrectly being placed into javax.swing.Popup

    XMLWordPrintable

    Details

      Description



      Name: js151677 Date: 08/20/2004


      FULL PRODUCT VERSION :
      java version "1.4.2_03"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_03-b02)
      Java HotSpot(TM) Client VM (build 1.4.2_03-b02, mixed mode)
      ------------------
      java version "1.4.1-p3"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.1-p3-root_11_oct_2003_00_19)
      Java HotSpot(TM) Client VM (build 1.4.1-p3-root_11_oct_2003_00_19, mixed mode)
      -----------------
      java version "1.4.2-p6"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2-p6-root_25_jun_2004_11_32)
      Java HotSpot(TM) Client VM (build 1.4.2-p6-root_25_jun_2004_11_32, mixed mode)


      ADDITIONAL OS VERSION INFORMATION :
      Microsoft Windows 2000 [Version 5.00.2195]
      FreeBSD 5.2.1-RELEASE-p4 FreeBSD 5.2.1-RELEASE-p4
      FreeBSD 4.9-STABLE


      EXTRA RELEVANT SYSTEM CONFIGURATION :
      XFree86 Version 4.3.0
        Release Date: 27 February 2003
      X Protocol Version 11, Revision 0, Release 6.6
      Build Operating System: FreeBSD 5.2.1 i386 [ELF]
      --------------
      X.org
        Release Date: 18 December 2003
      X Protocol Version 11, Revision 0, Release 6.7
      Build Operating System: FreeBSD 5.2.1 i386 [ELF]


      A DESCRIPTION OF THE PROBLEM :
      Components such as JComboBox doesn't work correct being placed into javax.swing.Popup which doesn't cross the border of JFrame. Drop down menu of a combo box while show gets covered with Popup. Same behaviour found with Tooltip.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Show java.swing.Popup with JComboBox inside JFrame.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      Expecting the drop down menu of JComboBox correcly shown on the display
      ACTUAL -
      A part of drop down menu that is inside popup's boundaries is shown under it.

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      import javax.swing.*;
      import java.awt.*;
      import java.awt.event.*;


      public class TestPopup extends JFrame {
        JPanel popupPanel = new JPanel();
        Popup popup = null;
        public TestPopup(String title) {
          super(title);
          
          JComboBox combo = new JComboBox(new String [] { "one", "two", "three" });
          JButton close = new JButton("hide");
          close.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent ae) {
              popup.hide();
              popup = null;
            }
          });
          popupPanel.setLayout(new BorderLayout());
          popupPanel.add(new JLabel("combo: "), BorderLayout.NORTH);
          popupPanel.add(combo, BorderLayout.CENTER);
          popupPanel.add(close, BorderLayout.SOUTH);

          Container c = getContentPane();
          c.setLayout(new BorderLayout());
          JButton button = new JButton("test");
          button.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent ae) {
              PopupFactory factory = PopupFactory.getSharedInstance();
              popup = factory.getPopup(TestPopup.this,
                popupPanel, getX() + 50, getY() + 50);
              popup.show();
            }
          });
          c.add(button, BorderLayout.CENTER);
        }

        public static void main(String args[]) {
          TestPopup frame = new TestPopup("test");
          frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
          frame.setSize(400, 400);
          frame.show();
        }
      }
      ---------- END SOURCE ----------
      (Incident Review ID: 297692)
      ======================================================================

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              kizune Alexander Zuev
              Reporter:
              jssunw Jitender S (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: