JDK-5042751 : JMenu popop stays on screen after iconify and deiconfy JFrame
  • 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-05-05
  • Updated: 2004-05-12
  • Resolved: 2004-05-12
Related Reports
Duplicate :  
Description

Name: gm110360			Date: 05/05/2004


FULL PRODUCT VERSION :
java version "1.4.2_04"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05)
Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode)

ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows XP [Version 5.1.2600]

A DESCRIPTION OF THE PROBLEM :
I have a JFrame with a JMenu.
When i iconify the frame while the JMenu is open and then deiconify the window (clicking on the window in the taskbar) the place where the popup of the JMenu was  is grayed in my Frame. Evene if i close the Frame the gray rectangle stays on the screen.

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Simple Example:

import javax.swing.*;

public class Test {
  public static void main(String args[]) {
          JFrame f = new JFrame();
          JMenu m = new JMenu("TEST");
          m.add (new JMenuItem("TEST 1"));
          m.add (new JMenuItem("TEST 2"));
          m.add (new JMenuItem("TEST 3"));
          JMenuBar mb = new javax.swing.JMenuBar();
          mb.add(m);
          f.setJMenuBar(mb);
          f.setSize(100,100);
          f.show();
      }
}
Open the Menu, iconfy the Frame and deiconify the Frame to see the effect.

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
There should be no gray rectangle after deiconify the Frame.
ACTUAL -
Gray Rectangle on my screen.

REPRODUCIBILITY :
This bug can be reproduced always.

---------- BEGIN SOURCE ----------
  public static void main(String args[]) {
          JFrame f = new JFrame();
          JMenu m = new JMenu("TEST");
          m.add (new JMenuItem("TEST 1"));
          m.add (new JMenuItem("TEST 2"));
          m.add (new JMenuItem("TEST 3"));
          JMenuBar mb = new javax.swing.JMenuBar();
          mb.add(m);
          f.setJMenuBar(mb);
          f.setSize(100,100);
          f.show();
      }
---------- END SOURCE ----------
(Incident Review ID: 260315) 
======================================================================

Comments
EVALUATION Name: sh120115 Date: 05/07/2004 Reproducible on Windows NT 4.0. I also noticed that after I've restored the frame, when I drag the main frame around the gray rectange stays in the same place on the screen. ###@###.### 2004-05-07 ====================================================================== Name: azR10139 Date: 05/12/2004 This issue is well known. The problem is inside an AWT code. Bug is duplicate of bug 4842599: REGRESSION: JPopupMenu not Hidden Properly After Iconified and Deiconified ###@###.### 2004-05-12 ======================================================================
12-05-2004