JDK-5089878 : Several swing components behave incorrectly being placed into javax.swing.Popup
  • Type: Bug
  • Component: client-libs
  • Sub-Component: javax.swing
  • Affected Version: 1.4.2
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: windows_xp
  • CPU: x86
  • Submitted: 2004-08-20
  • Updated: 2005-06-14
  • Resolved: 2005-06-14
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 6
6Resolved
Related Reports
Duplicate :  
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) 
======================================================================

Comments
EVALUATION Name: sh120115 Date: 08/20/2004 Interesting, showing a popup from a popup...wonder if we can support this properly. ###@###.### 2004-08-20 ====================================================================== Despites the fact that using of a JComboBox in a popup sounds strange to me we should take care of this. On the other hand it is definitely not a showstopper. Will be fixed in the upcoming release. ###@###.### 2004-08-24 This bug is caused by the same reasons as bug 5036146: REGRESSION: problems with 1.5.0 action listeners. Fix for the bug 5036146 also fixes this one. Closing as duplicate. ###@###.### 2005-06-14 15:50:20 GMT
14-06-2005

CONVERTED DATA BugTraq+ Release Management Values COMMIT TO FIX: mustang
25-09-2004