-
Bug
-
Resolution: Fixed
-
P4
-
1.2.0
-
1.2beta4
-
sparc
-
solaris_2.5
-
Verified
Name: sdC67446 Date: 11/11/97
java.awt.dnd.DragSourceContext.setCursor doesn't change cursor.
It always equals to null.
Here is the JDK Specification:
--------------------------------------------------
setCursor
public void setCursor(Cursor c)
change the drag cursor
Here is the test demonstrating the bug:
-----------------Test.java------------------------
import java.awt.dnd.*;
import java.awt.dnd.peer.*;
import java.awt.*;
public class Test {
public static void main(String[] args) {
DragSourceContextPeer dscp = new DragSourceContextPeer() {
Cursor cursor;
public void startDrag(DragSourceContext ds, AWTEvent trigger, int actions) {}
public Component getComponent() {return null;}
public boolean isDnDTrigger(AWTEvent awte) {return false;}
public void cancelDrag() {}
public void commitDrop() {}
public int getSourceActions() {return 0;}
public void setSourceActions(int a) {}
public Cursor getCursor() {return cursor;}
public void setCursor(Cursor c) {cursor = c;}
public AWTEvent getTrigger() {return null;}
};
DragSourceContext dsc = new DragSourceContext(null, dscp, null, 0, null, null, null, null);
dsc.setCursor(new Cursor(Cursor.DEFAULT_CURSOR));
if (dsc.getCursor() == null)
System.out.println("dsc.getCursor() == null.");
}
}
---------Output from the test---------------------
dsc.getCursor() == null.
--------------------------------------------------
======================================================================