Results 1 to 2 of 2
  1. #1
    0circle0 is offline Member
    Join Date
    Jul 2011
    Rep Power

    Question Mouse position in applet window not screen

    returns the location of the mouse on the screen; however I have been trying to find out how to just return the location relative to the applet no matter where its location on the screen is. How would I do that?

  2. #2
    0circle0 is offline Member
    Join Date
    Jul 2011
    Rep Power


    Found that if you take MouseInfo.getPointerInfo().getLocation().x - this.getLocationOnScreen().x you get the relative location. Guess I wasn't forming my question correctly in Google. Similar threads found it for me.

Similar Threads

  1. Repositioning components based on mouse position
    By robbie.26 in forum AWT / Swing
    Replies: 3
    Last Post: 06-21-2011, 07:55 AM
  2. Java Applet: drawing window bigger than screen
    By srbehera in forum Java Applets
    Replies: 2
    Last Post: 04-18-2011, 05:48 AM
  3. Problem with determing mouse position!!!
    By in forum New To Java
    Replies: 6
    Last Post: 07-15-2010, 06:09 PM
  4. Replies: 0
    Last Post: 06-25-2008, 11:32 AM
  5. Use the mouse position
    By susan in forum Java Applets
    Replies: 1
    Last Post: 07-29-2007, 12:10 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts