aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes Getting the Location of an Applet Component Relative to the Browser Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Getting the Location of an Applet Component Relative to the Browser" Watch "Getting the Location of an Applet Component Relative to the Browser" New topic
Author

Getting the Location of an Applet Component Relative to the Browser

Alec Lee
Ranch Hand

Joined: Jan 28, 2004
Posts: 569
I have defined my own custom Components running inside an Applet. I want to find their location relative to the browser window. Component.getLocation() returns the location relative to the parent only. Is there anyway to find the location relative to the browser window? Looks like I have to recursively calls getLocation() for all the parents until reaching the Applet. Are there any other alternatives?
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Getting the Location of an Applet Component Relative to the Browser