JDK-6253850 : REGRESSION: The setCursor(Cursor) doesn't work on 1.5.0
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 5.0
  • Priority: P3
  • Status: Closed
  • Resolution: Duplicate
  • OS: windows_2000
  • CPU: x86
  • Submitted: 2005-04-12
  • Updated: 2007-10-16
  • Resolved: 2005-04-12
Related Reports
Duplicate :  
Description
FULL PRODUCT VERSION :
jdk1.5.0_01

ADDITIONAL OS VERSION INFORMATION :
Windows 2000 5.00.2195 service pack 4

A DESCRIPTION OF THE PROBLEM :
I have created a test dialog box with a button.
When I change the cursor, nothing happen, I have the regular arrow.

        jButtonTest.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));

I use netbeans4.0 and when I switch back to jdk1.4.2 the cursor changes when the mouse is over this test button.

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
use setCursor anywhere, on JFrame, JButton.....

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
I expect to see the mouse cursor changed to the hourglass
ACTUAL -
No effect on the cursor

ERROR MESSAGES/STACK TRACES THAT OCCUR :
nothing

REPRODUCIBILITY :
This bug can be reproduced always.

---------- BEGIN SOURCE ----------
this is the code that I have created with NetBeans4.0

/*
 * Test.java
 *
 * Created on March 31, 2005, 11:27 AM
 */

package com.metapass.utils.screen.ui;
import java.awt.*;
/**
 *
 * @author  Administrator
 */
public class Test extends javax.swing.JDialog {
    
    /** Creates new form Test */
    public Test(java.awt.Frame parent, boolean modal) {
        super(parent, modal);
        initComponents();
        this.setSize(300,200);
        jButtonTest.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
    }
    
    /** 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() {
        jButtonTest = new javax.swing.JButton();
        
        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        jButtonTest.setText("Test Cursor");
        jButtonTest.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                jButtonTestMouseEntered(evt);
            }
        });
        
        getContentPane().add(jButtonTest, java.awt.BorderLayout.NORTH);
        
        pack();
    }
    
    private void jButtonTestMouseEntered(java.awt.event.MouseEvent evt) {
        
    }
    
    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new Test(new javax.swing.JFrame(), true).setVisible(true);
            }
        });
    }
    
    // Variables declaration - do not modify
    private javax.swing.JButton jButtonTest;
    // End of variables declaration
    
}

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

CUSTOMER SUBMITTED WORKAROUND :
using jdk 1.4.2  :-(

Release Regression From : 5.0
The above release value was the last known release where this 
bug was known to work. Since then there has been a regression.
###@###.### 2005-04-12 09:48:25 GMT