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 9 of 9

Thread: Clicking a coordinate on my GUI (Not Local Mouse Or Normal Robot.movemouse!)

  1. #1
    Junior Member
    Join Date
    Jun 2012
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Clicking a coordinate on my GUI (Not Local Mouse Or Normal Robot.movemouse!)

    Basically I want to click a coordinate on my GUI, where ever the GUI is, say if the user moves the screen or what not.

    I do NOT want to use the crappy getpixelcolor.

    I also do not want to use the local mouse, is this possible & is it possible if you could post some example code for use?

    Thanks <3


  2. #2
    Crazy Cat Lady KevinWorkman's Avatar
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    5,424
    My Mood
    Hungover
    Thanks
    144
    Thanked 636 Times in 540 Posts

    Default Re: Clicking a coordinate on my GUI (Not Local Mouse Or Normal Robot.movemouse!)

    Huh? What exactly does that mean? What exactly have you tried? What does getPixelColor() have to do with this, and why is it "crappy"?
    Useful links: How to Ask Questions the Smart Way | Use Code Tags | Java Tutorials
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

  3. #3
    Junior Member
    Join Date
    Jun 2012
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Clicking a coordinate on my GUI (Not Local Mouse Or Normal Robot.movemouse!)

    Quote Originally Posted by KevinWorkman View Post
    Huh? What exactly does that mean? What exactly have you tried? What does getPixelColor() have to do with this, and why is it "crappy"?
    Well, What I'm trying to say is I want to click a coordinate on my JFrame, not using the screen coordinates, and not using the local mouse.

  4. #4
    Administrator copeg's Avatar
    Join Date
    Oct 2009
    Location
    US
    Posts
    5,318
    Thanks
    181
    Thanked 833 Times in 772 Posts
    Blog Entries
    5

    Default Re: Clicking a coordinate on my GUI (Not Local Mouse Or Normal Robot.movemouse!)

    From what you posted, I do not understand what your goal is. Are you trying to get the color (or location) of a pixel anywhere on the user's screen (or JFrame) based upon where the user clicks? Please describe your goal in detail and what you've tried in detail, as this is pertinent to getting an answer other than a guess.

  5. #5
    Super Moderator pbrockway2's Avatar
    Join Date
    Jan 2012
    Posts
    987
    Thanks
    6
    Thanked 206 Times in 182 Posts

    Default Re: Clicking a coordinate on my GUI (Not Local Mouse Or Normal Robot.movemouse!)

    It might just be me, but what are these non local mice whose actions you are detecting or tying to detect?

  6. #6
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,139
    Thanks
    65
    Thanked 2,720 Times in 2,670 Posts

    Default Re: Clicking a coordinate on my GUI (Not Local Mouse Or Normal Robot.movemouse!)

    Or is the OP trying to send a MouseEvent representing a click to some listener?
    If you don't understand my answer, don't ignore it, ask a question.

  7. #7
    Crazy Cat Lady KevinWorkman's Avatar
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    5,424
    My Mood
    Hungover
    Thanks
    144
    Thanked 636 Times in 540 Posts

    Default Re: Clicking a coordinate on my GUI (Not Local Mouse Or Normal Robot.movemouse!)

    Or is he trying to click an exact location in the gui regardless of where it is on screen?

    All of this is doable, we just have to know exactly what you're trying to do before we can help you.
    Useful links: How to Ask Questions the Smart Way | Use Code Tags | Java Tutorials
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

  8. #8
    Junior Member
    Join Date
    Jun 2012
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Clicking a coordinate on my GUI (Not Local Mouse Or Normal Robot.movemouse!)

    Quote Originally Posted by KevinWorkman View Post
    Or is he trying to click an exact location in the gui regardless of where it is on screen?

    All of this is doable, we just have to know exactly what you're trying to do before we can help you.
    That's correct, but I do not want to use the local mouse, so it won't be annoying to users, when a program is controlling their own mouse.

  9. #9
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,139
    Thanks
    65
    Thanked 2,720 Times in 2,670 Posts

    Default Re: Clicking a coordinate on my GUI (Not Local Mouse Or Normal Robot.movemouse!)

    Can you explain what you expect the program to receive and to do when this clicking event happens?
    If you don't understand my answer, don't ignore it, ask a question.

Similar Threads

  1. Replies: 8
    Last Post: April 21st, 2013, 08:20 AM
  2. creating admin and normal users
    By trisin in forum Java IDEs
    Replies: 4
    Last Post: June 20th, 2012, 11:50 AM
  3. [SOLVED] Is This Closing To Code Normal?
    By Java Programmer in forum What's Wrong With My Code?
    Replies: 3
    Last Post: January 8th, 2012, 02:08 AM
  4. Replies: 3
    Last Post: May 21st, 2011, 08:47 AM
  5. Java program to contol computer mouse using the awt Robot and events
    By JavaPF in forum Java Code Snippets and Tutorials
    Replies: 3
    Last Post: February 11th, 2009, 04:17 PM