JDK-6372909 : Empty popup shown after minimizing a frame
  • Type: Bug
  • Component: client-libs
  • Sub-Component: javax.swing
  • Affected Version: 6
  • Priority: P3
  • Status: Closed
  • Resolution: Duplicate
  • OS: generic
  • CPU: generic
  • Submitted: 2006-01-16
  • Updated: 2011-01-19
  • Resolved: 2006-01-23
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.
Other
5.0u8Resolved
Related Reports
Duplicate :  
Relates :  
Description
FULL PRODUCT VERSION :
java version "1.5.0-beta2"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0-beta2-b44)

ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows XP

A DESCRIPTION OF THE PROBLEM :
When popup menu is shown and frame is minimized and than maximized again,
an empty popup is incorrectly shown 

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1. Run the test
2. Click on the menu item
3. Minimize and maximize the frame

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
No popups are shown after maximizing
ACTUAL -
An empty popup is shown

REPRODUCIBILITY :
This bug can be reproduced always.

public class PopupTest {
    public static void main(String[] args) {
        final JFrame frame = new JFrame();
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        JPanel jpanel = new JPanel();
        jpanel.setLayout(null);
        jpanel.setBackground(new Color(100, 100, 255));
        JMenuBar jmenubar = new JMenuBar();
        jmenubar.setVisible(true);
        jmenubar.setBounds(0, 0, 200, 20);
        JMenu jmenu = new JMenu();
        jmenu.setText("Click me");
        JMenuItem jmenuitem = new JMenuItem();
        jmenuitem.setText("Don't clickme. You should minimize shell.");
        jmenu.add(jmenuitem);
        jmenubar.add(jmenu);
        jpanel.add(jmenubar);
        frame.add(jpanel);
        frame.setSize(200, 200);
        frame.setVisible(true);
    }
}

Comments
WORK AROUND frame.addWindowListener(new WindowAdapter() { public void windowDeiconified(WindowEvent e) { Window[] wins = e.getWindow().getOwnedWindows(); for (Window win : wins) { if ("###overrideRedirect###".equals(win.getName())) { win.setVisible(true); win.setVisible(false); } } } });
16-01-2006

EVALUATION This happens because of AWT bug #4471924 Since it is difficult to fix on AWT side, we should fix it on the Swing side Fix should use a suggested workaround
16-01-2006