Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

drag and drop cursor  RSS feed

 
robyn byrd
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm writing an app that allows me to drag a blue square (JPanel) on a canvas (another JPanel) and drop it at another location on the canvas. The dnd works, but I would like to know if there is a way to change the dnd cursor to a hand during the drag and return to the normal cursor when the drop occurs.
Thanks in advance..
 
Jerome Butcher-Green
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
its weird ...i need extensive help with draging and dropping (i dont know anything about it) so if you know of any good online guides (ive seen a few but they focus on transfering objects ...i just wanna move polygons around!)

anyway while playin arounjd with this dnd business i wanted to change to a hand also and found to do this is simple! replace

(or which ever you used) in

with

so you get

-somethin like that

there are of coarse several cursors (you can make your own if you like) but you can see em all at (goto java.awt then the Cursor class) http://java.sun.com/j2se/1.5.0/docs/api/ *note thats 1.5 so it might not work with earlier versions!

later
-Jerome BG
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!