Go Back   CodingForums.com > :: Server side development > Java and JSP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 06-21-2012, 10:12 PM   PM User | #1
TestingPHP
New Coder

 
Join Date: Jun 2012
Posts: 69
Thanks: 0
Thanked 0 Times in 0 Posts
TestingPHP is an unknown quantity at this point
java mouse click coordinates [EvenMouselistener]

Can someone give me a example?

Basically I need it to link my ad http://eps-world.org/programming/

I'm not sure what the coordinates are that's the issue.
TestingPHP is offline   Reply With Quote
Old 06-21-2012, 11:07 PM   PM User | #2
Fou-Lu
God Emperor


 
Fou-Lu's Avatar
 
Join Date: Sep 2002
Location: Saskatoon, Saskatchewan
Posts: 15,635
Thanks: 4
Thanked 2,448 Times in 2,417 Posts
Fou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to all
PHP Code:
public void mouseClicked(MouseEvent e)
{
    
Point relativeP e.getPoint();
    
Point absoluteP e.getPointOnScreen();

Then work with the points. One is relative to the component and the other is absolute.
Fou-Lu is offline   Reply With Quote
Old 06-23-2012, 10:35 AM   PM User | #3
TestingPHP
New Coder

 
Join Date: Jun 2012
Posts: 69
Thanks: 0
Thanked 0 Times in 0 Posts
TestingPHP is an unknown quantity at this point
Quote:
Originally Posted by Fou-Lu View Post
PHP Code:
public void mouseClicked(MouseEvent e)
{
    
Point relativeP e.getPoint();
    
Point absoluteP e.getPointOnScreen();

Then work with the points. One is relative to the component and the other is absolute.
Could you give me a better example? one that will click a coordinate e.g X=400 Y=400?
TestingPHP is offline   Reply With Quote
Old 06-23-2012, 04:33 PM   PM User | #4
Fou-Lu
God Emperor


 
Fou-Lu's Avatar
 
Join Date: Sep 2002
Location: Saskatoon, Saskatchewan
Posts: 15,635
Thanks: 4
Thanked 2,448 Times in 2,417 Posts
Fou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to all
You mean perform a click, not where it was clicked? You can't do that with a mouse listener. You have to use a robot for that.
Fou-Lu is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 02:45 PM.


Advertisement
Log in to turn off these ads.