JDK-4100819 : Java 1.1.x can't set cursor on a Frame and all its children
  • Type: Enhancement
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 1.1.5
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: windows_nt
  • CPU: other
  • Submitted: 1997-12-19
  • Updated: 2001-08-03
  • Resolved: 2001-08-03
Related Reports
Duplicate :  
Description
It used to be in 1.0.2 that you could only set a cursor
for the whole window. Now in JDK 1.1 its per component.
If a component explicitly sets a cursor, it overrides the value inherited
from its parent window.
Only text components  seem to do this in the core AWT. 
    
One consequence is that if using the old 1.0 semantics a programmer
sets a cursor on the frame to indicate (in this case) that a window
is busy, then the busy cursor is overridden when the pointer moves
over a component which has explicitly set a cursor.
    
The programmer likes being able to set a per-component cursor
but also wants a way to get the old behaviour too.

Test case below, note that the cursor on the TextField is a caret.
import java.awt.*;

public class CursorTest extends Frame
{  Button b;
   Panel p;
	public CursorTest()
	{
                p = new Panel();
		setLayout(new FlowLayout());
		p.add(b=new Button("Button1"));
		p.add(new Label("Label1"));
		p.add(new Checkbox("Checkbox"));
		p.add(new TextField("Button1"));
	        add("Center",p);
		pack();
		reshape(100,100,300, 400);
		show();
		setCursor(new Cursor(Cursor.WAIT_CURSOR));
	}

	public static void main(String[] args)
	{
		new CursorTest();
	}
}

Comments
EVALUATION This is covered in the cursor proposal made by dpm. xianfa.deng@Eng 1999-12-22 commit to tiger. xianfa.deng@Eng 2000-01-21 Name: rpR10076 Date: 08/03/2001 ###@###.### This problem is already described in bug id 4093819. Closing out as a duplicate. ======================================================================
11-06-2004

PUBLIC COMMENTS It used to be in 1.0.2 that you could only set a cursor for the whole window. Now in JDK 1.1 its per component. If a component explicitly sets a cursor, it overrides the value inherited from its parent window.
10-06-2004