Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Setting the drag cursor for Drag and Drop

Status
Not open for further replies.

scarlon

Programmer
May 15, 2001
1
US
Hi all,

I am looking for help with Java's Drag and Drop API. I want to display my own drag cursor to indicate that I am dragging a transferable object from one part of my applet to another. (within the same applet)

I need help with two problems:

1. I find I can create a cursor to look like a tiny version of the image I want to use, but it is limited to 32 X 32 pixels. This is the value I get when I call getBestCursorSize(). Is there a way to drag a bigger cursor around the screen on the Windows NT platform?

2. When I create the cursor described above and pass it to the DragSource.startDrag() method, it appears momentarily on the screen, only to be replaced with the system default drag/drop cursor as soon as the first DropTarget is entered. I think the system is responding to dragEnter() events by setting the cursor, what I don't know is how to override this behavior. I notice that the system cursors are defined in static final methods in DragSource.java. Is there any way to override this default cursor? How do I prevent the resetting of the cursor to this default cursor?

Thanks in advance,

Jim Carlson
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top