Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 5 of 5

Thread: Is there a class to...

  1. #1
    Junior Member
    Join Date
    Nov 2011
    Posts
    8
    My Mood
    Sleepy
    Thanks
    0
    Thanked 2 Times in 1 Post

    Default Is there a class to...

    Is there a class which sees if you are clicking right now? I don't mean mouse events, but some sort of event which sees if you click somewhere on the screen.

    Thanks.


  2. #2
    Grand Poobah
    Join Date
    Mar 2011
    Posts
    1,545
    My Mood
    Grumpy
    Thanks
    0
    Thanked 167 Times in 158 Posts

    Default Re: Is there a class to...

    errrr that's exactly what the MouseEvent class is for. Can you explain what you are trying to do, not how you are trying to solve it.
    Improving the world one idiot at a time!

  3. #3
    Super Moderator helloworld922's Avatar
    Join Date
    Jun 2009
    Posts
    2,895
    Thanks
    23
    Thanked 619 Times in 561 Posts
    Blog Entries
    18

    Default Re: Is there a class to...

    Do you mean listening to all mouse events regardless of where's being clicked?

    In pure Java, no.

    Pure Java applications can only listen to mouse events registered with one of their components.

  4. #4
    Junior Member
    Join Date
    Nov 2011
    Posts
    8
    My Mood
    Sleepy
    Thanks
    0
    Thanked 2 Times in 1 Post

    Default Re: Is there a class to...

    Quote Originally Posted by helloworld922 View Post
    Do you mean listening to all mouse events regardless of where's being clicked?
    Yes that's exactly what I mean. I don't mean on any Component but anywhere, anytime on the screen.

    I'm making a programm which records your mouse movements and clicks. I currently have the mouse movement recording, but since there is no Class or some mouse event, and I am unexperienced with JNI, this project kinda drops dead.

  5. #5
    Super Moderator helloworld922's Avatar
    Join Date
    Jun 2009
    Posts
    2,895
    Thanks
    23
    Thanked 619 Times in 561 Posts
    Blog Entries
    18

    Default Re: Is there a class to...

    You may consider taking a look at this:

    http://www.javaprogrammingforums.com...ui-editor.html

    It's Windows-specific, but it does basically what you want to do.

Similar Threads

  1. [SOLVED] Storing instances of a Sub Class in it's Super Class (Which is an array)
    By Hiroto in forum Object Oriented Programming
    Replies: 5
    Last Post: November 6th, 2011, 10:36 AM
  2. Replies: 7
    Last Post: July 21st, 2011, 02:29 PM
  3. Replies: 3
    Last Post: April 13th, 2011, 03:30 PM
  4. Help requested - testing a class with a tester class, no methods allowed.
    By miketeezie in forum What's Wrong With My Code?
    Replies: 3
    Last Post: February 21st, 2011, 10:40 PM
  5. Replies: 0
    Last Post: April 11th, 2010, 08:56 AM