• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to capture Mouse movement ??

 
rajendra peddinti
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
can i get the basic idea of capturing the mouse moves...

sorry guys i've posted the same in the java intermediate section and couldn't make it out(infact, my question is not proper there)

thank you
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you add a MouseListener to a component for the following events
pressed/released/clicked/entered/exited

you add a MouseMotionListener to a component for the following events
dragged/moved

read the api docs for both.

here's a couple of links to the tutorials
http://java.sun.com/docs/books/tutorial/uiswing/events/mouselistener.html
http://java.sun.com/docs/books/tutorial/uiswing/events/mousemotionlistener.html
 
rajendra peddinti
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks Michael!!

i got it immediately after i posted here. I know i can do it if i spend some time on it. but, yester day i am in a hurry .

anyways thanks for your time.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic