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

REGRESSION: JPopupMenu not Hidden Properly After Iconified and Deiconified

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 6
    • 4.4, 4.5, 1.3.1, 1.4.0, 1.4.1, 1.4.2_08, 5.0, 6
    • client-libs
    • b49
    • generic, x86
    • generic, linux, windows_nt, windows_2000, windows_xp
    • Verified

        Name: jk109818 Date: 04/03/2003


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


        FULL OPERATING SYSTEM VERSION :
        Windows 2000 Service Pack 3

        A DESCRIPTION OF THE PROBLEM :
        After a popup menu is shown partially outside the window
        frame, minimize the window and then click the icon to show
        the window again, the whole area of the pop menu will stay
        opaque like a hanging application. And it will stay as long
        as the same popup menu is triggered and shown totally
        within the frame.

          To make it go away, you have to trigger it and show the
        popup menu partially outside the window again.

        STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
        1. Compile the example code
        2. Right mouse click somewhere near the window boundary
        3. Minimize the window by clicking the minimize icon
        4. Click the application icon to bring back the window

        EXPECTED VERSUS ACTUAL BEHAVIOR :
        The popup menu should disappear completely. But in the
        example, the popup menu area will seem like application
        hanging.

        REPRODUCIBILITY :
        This bug can be reproduced always.

        ---------- BEGIN SOURCE ----------
        package com.tg.test;
        import java.awt.event.*;
        import javax.swing.*;

        public class OutOfBoundPopupTest extends javax.swing.JFrame
        {
          private JPopupMenu popupMenu;
          /** Creates new form OutOfBoundPopupTest */
          public OutOfBoundPopupTest()
          {
            initComponents();
            initUI();
          }
          
          private void initUI()
          {
            setTitle("Out of Bound PopupMenu Test");
            popupMenu = new JPopupMenu();
            JMenuItem menuItem1 = new JMenuItem("MenuItem Test 1");
            JMenuItem menuItem2 = new JMenuItem("MenuItem Test 2");
            JMenuItem menuItem3 = new JMenuItem("MenuItem Test 3");
            JMenuItem menuItem4 = new JMenuItem("MenuItem Test 4");
            JMenuItem menuItem5 = new JMenuItem("MenuItem Test 5");
            JMenuItem menuItem6 = new JMenuItem("MenuItem Test 6");
            popupMenu.add(menuItem1);
            popupMenu.add(menuItem2);
            popupMenu.add(menuItem3);
            popupMenu.add(menuItem4);
            popupMenu.add(menuItem5);
            popupMenu.add(menuItem6);
            
            testPanel.addMouseListener(new MouseAdapter()
            {
              public void mouseReleased(MouseEvent e)
              {
                if(e.isPopupTrigger())
                {
                  popupMenu.show(testPanel, e.getX(), e.getY());
                }
              }
            });
            
            setSize(200,100);
          }
          
          /** This method is called from within the constructor to
           * initialize the form.
           * WARNING: Do NOT modify this code. The content of this method is
           * always regenerated by the Form Editor.
           */
          private void initComponents()
          {
            testPanel = new javax.swing.JPanel();

            addWindowListener(new java.awt.event.WindowAdapter()
            {
              public void windowClosing(java.awt.event.WindowEvent evt)
              {
                exitForm(evt);
              }
            });

            testPanel.setMaximumSize(new java.awt.Dimension(100, 40));
            testPanel.setMinimumSize(new java.awt.Dimension(100, 40));
            testPanel.setPreferredSize(new java.awt.Dimension(100, 40));
            getContentPane().add(testPanel, java.awt.BorderLayout.CENTER);

            pack();
          }
          
          /** Exit the Application */
          private void exitForm(java.awt.event.WindowEvent evt)
          {
            System.exit(0);
          }
          
          /**
           * @param args the command line arguments
           */
          public static void main(String args[])
          {
            new OutOfBoundPopupTest().show();
          }
          
          
          // Variables declaration - do not modify
          private javax.swing.JPanel testPanel;
          // End of variables declaration
          
        }

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

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

        (Review ID: 181260)
        ======================================================================

              vbaranovsunw Vyacheslav Baranov (Inactive)
              jkimsunw Jeffrey Kim (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: