This week's book giveaway is in the
We're giving away four copies of a choice of
"Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac"
and have Joe Kissell on-line!
A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Win a copy of
Take Control of Upgrading to Yosemite
Take Control of Automating Your Mac
this week in the
Swing / AWT / SWT
Is there any tool to find the location of a componenet in the frame in Swing?
Joined: Oct 11, 2005
Mar 17, 2011 22:56:39
We have tool to locate each component in a web page. Also we can change the location of component in run-time.
I need a similar tool to locate each component in a frame.
It will be very useful to locate the component, if it not visible in frame.
Joined: Jul 26, 2007
Mar 17, 2011 23:27:54
I am not aware of any such tool. I doubt if its more than a few lines of code.
From the top of my head, in pseudo code
1) Get all child components inside a Container(hint)
2) Get the bounds(hint) of each child
3) Use recursion
How to ask questions
Donate a pint, save a life!
Onff-turn it on!
Joined: Oct 13, 2005
Mar 18, 2011 04:02:17
Don't you get the components as an array if you use the right method, so you can recursively traverse that array?
Joined: May 03, 2008
Mar 18, 2011 04:42:27
- get the component's location on screen
- get the window ancestor for the component (
- get the window's location on screen
- do the math
There are no new questions, but there may be new answers.
subject: Is there any tool to find the location of a componenet in the frame in Swing?
Is there a way to find out color of whatever's behind my frame?
Detecting Startup Folder on Windows
Saving panel content?
how to change the image pixel color on particular location
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2014