Win a copy of Svelte and Sapper in Action this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

drag and drop cursor

 
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..
 
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
 
Quick! Before anybody notices! Cover it up with this tiny ad:
the value of filler advertising in 2020
https://coderanch.com/t/730886/filler-advertising
    Bookmark Topic Watch Topic
  • New Topic