Java Q

Discussion in 'OT Technology' started by [DWI], Dec 4, 2003.

  1. [DWI]

    [DWI] Master of Nothing

    Joined:
    Aug 6, 2000
    Messages:
    21,936
    Likes Received:
    0
    Location:
    Maine
    is there an easy way to get the X value of the position of the mouse?
     
  2. yea there is but i forgot, look at the docs for Graphics class
     
  3. SLED

    SLED build an idiot proof device and someone else will

    Joined:
    Sep 20, 2001
    Messages:
    28,118
    Likes Received:
    0
    Location:
    AZ, like a bauce!
    in windows? why don't you just use an WIN32 API call

    the function (i believe, it's been awhile) is GetCursorPos
     
  4. drewski_amk

    drewski_amk Guest

    here is what you want:

    if you pass in a MouseEvent me (or whatever) to a function like mousePressed, etc. use me.getX() and me.getY(). returns an int
     
  5. there we go
     

Share This Page