Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / GUI / May 2005

Tip: Looking for answers? Try searching our database.

BorderLayout size updating

Thread view: 
- - 21 May 2005 07:19 GMT
I have a component at the center of a borderlayout and another component
at the south.  when i relocate the latter to one of the other four
sides, the component resizes appropriately but
System.out.println(component) shows that the sizes shown are the
previous location's size.

When I move to the east from the south, and println, it shows the size
of east.

Any idea how o make the sizes updated?
ByteCoder - 21 May 2005 13:58 GMT
> I have a component at the center of a borderlayout and another
> component at the south.  when i relocate the latter to one of the
[quoted text clipped - 6 lines]
>
> Any idea how o make the sizes updated?

Are you sure that the Component method: public Dimension getSize(); and
on the returned Dimension: double getHeight() and double getWidth()
don't work?

Signature

-------------
- ByteCoder -           ...I see stupid people
-------------
                  Curiosity *Skilled* the cat

- - 22 May 2005 00:54 GMT
>>Any idea how o make the sizes updated?
>
> Are you sure that the Component method: public Dimension getSize(); and
> on the returned Dimension: double getHeight() and double getWidth()
> don't work?

That's okay.
After hours of trial and error I solved it simply by replacing

revalidate()
repaint()

with

validate()
ByteCoder - 22 May 2005 11:26 GMT
>>>Any idea how o make the sizes updated?
>>
[quoted text clipped - 11 lines]
>
> validate()

Oh yes, such fine human errors. I know all about it... *sigh* ;)

Signature

-------------
- ByteCoder -           ...I see stupid people
-------------
                  Curiosity *Skilled* the cat

Christian Kaufhold - 21 May 2005 16:37 GMT
> I have a component at the center of a borderlayout and another component
> at the south.  when i relocate the latter to one of the other four
[quoted text clipped - 4 lines]
> When I move to the east from the south, and println, it shows the size
> of east.

Please post a compilable example.

Christian


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.