JDK-6294063 : REGRESSION: JDialog with glasspane does not shows the assigned cursor
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 5.0
  • Priority: P3
  • Status: Closed
  • Resolution: Duplicate
  • OS: windows_xp
  • CPU: x86
  • Submitted: 2005-07-05
  • Updated: 2011-02-16
  • Resolved: 2005-07-15
Related Reports
Duplicate :  
Description
FULL PRODUCT VERSION :
java version "1.5.0_03"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_03-b07)
Java HotSpot(TM) Client VM (build 1.5.0_03-b07, mixed mode, sharing)


ADDITIONAL OS VERSION INFORMATION :
Linux tprobert 2.6.11-1.27_FC3 #1 Tue May 17 20:27:37 EDT 2005 i686 i686 i386 GNU/Linux

Microsoft Windows XP [Versi��n 5.1.2600]

A DESCRIPTION OF THE PROBLEM :
The standard practice to use a visible glasspane to show the WAIT cursor, does not works when it is used on a JDialog using the internal hidden frame (JDialog no aruments constructor). the cursor does not change.

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Instantiante a Dialog, set a glasspane to it visible and assign the wait cursor to the glasspane

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
The WAIT cursor must be shown when the mouse hovers over the dialog content pane
ACTUAL -
the cursor does not changes

REPRODUCIBILITY :
This bug can be reproduced always.

---------- BEGIN SOURCE ----------
import java.awt.Cursor;
import java.awt.event.MouseAdapter;

import javax.swing.JButton;
import javax.swing.JDialog;
import javax.swing.JPanel;

public class TestDialog {
    public static void main(String[] args) {
        JDialog dialog = new JDialog();

        JPanel glass = new JPanel();
        glass.setOpaque(false);
        glass.addMouseListener(new MouseAdapter() {
        });
        glass.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
        dialog.setGlassPane(glass);
        glass.setVisible(true);

        dialog.getContentPane().add(new JButton("Hola"));
        dialog.pack();
        dialog.setVisible(true);
    }
}
---------- END SOURCE ----------

CUSTOMER SUBMITTED WORKAROUND :
Create a non decorated JFrame with bounds (0,0,0,0) ans use it as the parent of the dialog

Release Regression From : 1.4.2_08
The above release value was the last known release where this 
bug was known to work. Since then there has been a regression.
###@###.### 2005-07-05 09:03:32 GMT

Comments
EVALUATION I seem to recall another recent bug reporting this problem. Cursors don't seem to work with JDialogs having a hidden parent. AWT owns this bug and should be able to find the duplicate. ###@###.### 2005-07-15 18:37:18 GMT
15-07-2005