JDK-6178382 : Setting the cursor to CROSSHAIR_CURSOR in a JFrame displays TEXT_CURSOR instead
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 1.4.2
  • Priority: P4
  • Status: Closed
  • Resolution: Not an Issue
  • OS: windows_xp
  • CPU: x86
  • Submitted: 2004-10-13
  • Updated: 2006-07-25
  • Resolved: 2006-07-25
Related Reports
Relates :  
Description
FULL PRODUCT VERSION :
JRE 1.4.2_05 build 1.4.2_05-b04
JRE 1.4.1_07 build 1.4.1_07-b02


ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows XP Professional
Version 2002
Service Pack 2
version 5.1 (number 2600.xpsp2_sp2_rtm.040803-2158 : Service Pack 2)

A DESCRIPTION OF THE PROBLEM :
When asking for a crosshair cursor, I get the text cursor instead.

If I change the cursor scheme using the Windows config panel, and then run my program again, I get the appropriate crosshair cursor. If I go back to my initial cursor scheme, I also get the appropriate crosshair cursor.

But then, if I reboot my computer, the problem reappears (i.e. I get the TEXT_CURSOR instead of the CROSSHAIR_CURSOR).

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Just run the provided code, and put your mouse inside the JFrame.

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
I was expecting the window to display the crosshair cursor
ACTUAL -
The window displays the text cursor

REPRODUCIBILITY :
This bug can be reproduced always.

---------- BEGIN SOURCE ----------
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;

public class Crosshair extends JFrame {

    public Crosshair(){
	Container cpane=this.getContentPane();
	JPanel p1=new JPanel();
	cpane.add(p1);
	p1.setCursor(Cursor.getPredefinedCursor(Cursor.CROSSHAIR_CURSOR));
	WindowListener w0=new WindowAdapter(){
		public void windowClosing(WindowEvent e){System.exit(0);}
	    };
	this.addWindowListener(w0);
	this.setSize(200,200);
	this.setVisible(true);
    }

    public static void main(String[] args){
	Crosshair t=new Crosshair();
    }

}
---------- END SOURCE ----------
###@###.### 10/13/04 11:51 GMT

Comments
EVALUATION I've changed the bug substatus to reflect that we can reproduce the bug, but it is definitely not related to Java in any way (see the evaluation above). The root cause has not been found yet. SDN comments from those who can reproduce might be helpful in searching for the root cause. Please leave your detailed system information, including your Windows version, your video card model and video card driver version. What I suspect now as the root cause is the NVIDIA GeForce FX Go5200 video card, or its drivers. Unfortunately there's not enough information from the users to be sure.
25-07-2006

EVALUATION Due to a number of SDN comments, I decided to re-evaluate this bug. Preliminary evidence from the commenters indicates that this is not a Java bug, it is easily reproducible without Java. You can use the following HTML file to reproduce the problem in your browser: <html><body style="cursor:crosshair;">Test</body></html>. I suppose you can use any browser, at least IE and Firefox will work. It should display the crosshair cursor over the word "Test". Those who can reproduce this Java bug have text cursor displayed instead on this page. I think we should investigate further to find out the root cause and to advise the users on how to fix this, or to work around this problem in Java.
28-03-2006

EVALUATION Closing the bug as no feedback has been received. Feel free to reopen if necessary.
13-03-2006

EVALUATION Could not be reproduced neither with 1.4.2 nor with current Mustang build on Windows XP SP2. Tried on multiple systems. Please provide more info to reproduce this bug. I'd suggest trying to reproduce it on a different machine to be sure it is not caused by a corrupted OS installation or some software interoperability problem. ###@###.### 2005-07-04 13:11:09 GMT
04-07-2005