Mouse position capturing


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 4 of 4

Thread: Mouse position capturing

  1. #1
    Join Date
    Mar 2006
    Posts
    3

    Mouse position capturing

    Hi All,
    Can you help me following on matter?

    I have tried to capture the mouse pointer's x, y coordinations from java applications when the mouse pointer is loss the focus from the java application(ex. out of the boundry of a JFrame). There is a method in windows platform with the windows api and JNI but I want to do this in a platform independent manner.

    Best Regards,
    Lakshitha

  2. #2
    Join Date
    Dec 2004
    Location
    San Bernardino County, California
    Posts
    1,468
    This is a place where the design decisions made with Java prevent you from doing what you say you want, outside of an API which exposes access to operating system functionality to you. What is going on outside of your program is outside of your program. There are only a limited avenues to communicate from the other programs to your Java program. JNI is one of them. Any of these avenues will be operating system dependent.

  3. #3
    Join Date
    Mar 2006
    Posts
    3
    That mean, Can't we do it even in the java 5.0?

  4. #4
    Join Date
    Dec 2004
    Location
    San Bernardino County, California
    Posts
    1,468
    Even in Java 1.5. In order to read mouse coordinates you need to "listen" to the mouse pointer (interrupt then pass on). In order to do this outside of the Java Virtual Machine which is executing your program, you need to insert that listening process into the operating system. THAT is operating system specific.

Similar Threads

  1. Icon infomration from Mouse position
    By eliminater in forum VB Classic
    Replies: 0
    Last Post: 09-01-2005, 07:15 AM
  2. Capturing Mouse Movements outside of screen resolution
    By Chris Eastwood in forum VB Classic
    Replies: 4
    Last Post: 03-28-2002, 01:26 PM
  3. position of mouse in NN6
    By Riki Fridrich in forum Web
    Replies: 4
    Last Post: 03-05-2001, 11:51 PM
  4. Mouse Position
    By Ranger in forum VB Classic
    Replies: 2
    Last Post: 12-07-2000, 01:29 PM
  5. Mouse Position
    By Ranger in forum VB Classic
    Replies: 0
    Last Post: 12-07-2000, 01:23 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center