• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

mouse related

 
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
first:
we know that we can get co-ordinates of mouse pointer
through functions in
like
int a=getX();(for getting x co.)
similarly i wanna know that can we set mouse pointer to particular point
via any function call.please help me.

second:
we know that when we press mouse button certain event is generaated which is passed to operating system .
simillarly can we generate that event by ourself(expl), that is without clicking the mouse but generating that event.
help me to solve my problems
thanks in advance
bye
 
Ranch Hand
Posts: 1071
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Look at the java.awt.Robot class. It has methods to move the mouse, generate mouse and keyboard events, move the mouse around, screen capture, etc...
 
Ranch Hand
Posts: 209
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Dear Steven,
While you posted this reply I was going through MouseEvent's API. I came across a method translatePoint(int x, int y). What is it used for? I didn't understand what they explained. It sounded something like changing the mouse position. Please explain.
 
author and iconoclast
Posts: 24207
46
Mac OS X Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It just changes the x and y values that will be returned by getX() and getY(). It doesn't move the mouse pointer.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic