How to Get the Real Size of a Figure [message #162042] |
Fri, 17 December 2004 23:35  |
Eclipse User |
|
|
|
Originally posted by: wudong.At.sklse.org
Hi, All:
I don't know if the sbject is proper. but my intension is :
When i create a figure, hasing a ToolbarLayout, and add some sub-figures(such as Label) to it. Just after that, i want to know the real size of the figure in other to put in on a proper position on the canvas.
the getSize() and getBounds always return the same value nomather what was added to the containing figure.
How to solve this problem?
It's urgent. hope some one can help me out.
Thank you.
|
|
|
Re: How to Get the Real Size of a Figure [message #162050 is a reply to message #162042] |
Sat, 18 December 2004 00:50  |
Eclipse User |
|
|
|
> I don't know if the sbject is proper. but my intension is :
> When i create a figure, hasing a ToolbarLayout, and add some
> sub-figures(such as Label) to it. Just after that, i want to know the real
> size of the figure in other to put in on a proper position on the canvas.
> the getSize() and getBounds always return the same value nomather what was
> added to the containing figure.
When in doubt try getPreferredSize(). And if you need to pass it hints, use
(-1, -1) which means that it should use whatever space it needs.
I hope this helps you.
--
Rob Grzywinski
|
|
|
Powered by
FUDForum. Page generated in 0.03128 seconds