• 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
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Knute Snortum
  • Bear Bibeault
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Frits Walraven
  • Carey Brown
  • Tim Holloway

How to use the Hand cursor on an Image !!!!

 
Ranch Hand
Posts: 103
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I have a main Jframe which contains a Jpanel which contains a jscrollpane. THe image is in scrollpane and i would like to use the Hand cursor to move the image up and down the jscrollpane.
Can someone tell me or show me how can i use a hand cursor on an image
I would appreciate if someone can show me a simple example.
THanks in advance.
 
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hey,
try the following in the dragGestureRecognised() method of ur DRAGGABLE:
Cursor cursor = new Cursor(Cursor.HANDCUR....);
event.startDrag(cursor, transferable(path), this);
good luck,
hetal seth
 
sam patel
Ranch Hand
Posts: 103
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by Hetal Seth:
hey,
try the following in the dragGestureRecognised() method of ur DRAGGABLE:
Cursor cursor = new Cursor(Cursor.HANDCUR....);
event.startDrag(cursor, transferable(path), this);
good luck,
hetal seth


Hi Hetal,
Thank you for your reply.
I am kind of new to this.
What is the dragGestureRecognised() method.

I created the Cursor cursor = new Cursor(Hand_Cursor).
I also created mouseDragged(MouseEvent e).
But there is no e.startDrag() method.
Can you please tell me where did you get the event.startDrag() method.
Again thanks.
 
Hetal Seth
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
i am under the impression that ur tryin to use DragnDrop functionality for ur application. if it is true, then u might have to refer the java.awt.dnd package.
-hetal-
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!