AppletTalk.com Forum Index AppletTalk.com
Java discussions newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

pack() on a JInternalFrame with BorderLayout does not size c

 
Post new topic   Reply to topic    AppletTalk.com Forum Index -> Java Help
View previous topic :: View next topic  
Author Message
Guest






PostPosted: Mon Mar 20, 2006 4:12 pm    Post subject: pack() on a JInternalFrame with BorderLayout does not size c Reply with quote



I need to get the size of a component that is added as CENTER. This
works on a JFrame but not an internal frame. I thought pack() would
handle this but the size remains zero. I do not want to hard code the
size of my center component. How can I make the layout manager size
this component?
Back to top
Guest






PostPosted: Mon Mar 20, 2006 8:12 pm    Post subject: Re: pack() on a JInternalFrame with BorderLayout does not si Reply with quote



Apparently, pack does nothing until the internal frame is added to the
desktop pane. I passed the desktop pane into the constructor and had it
add itself to the desktop pane.
Then, pack works. wow, what a pain in the arse!
Back to top
Oliver Wong
Guest





PostPosted: Mon Mar 20, 2006 9:12 pm    Post subject: Re: pack() on a JInternalFrame with BorderLayout does not si Reply with quote



<dmcrane (AT) gmail (DOT) com> wrote in message
news:1142885183.882671.254300 (AT) i39g2000cwa (DOT) googlegroups.com...
Quote:
Apparently, pack does nothing until the internal frame is added to the
desktop pane. I passed the desktop pane into the constructor and had it
add itself to the desktop pane.
Then, pack works. wow, what a pain in the arse!

Usually you call pack() after all the components have been added, to let
the LayoutManager know "Okay, go ahead and actually lay the components out;
I'm done messing around." If you call pack() too early, some of the
assumptions that the layout manager is going to make will turn out to be
false, and you'll get weird results.

- Oliver
Back to top
Display posts from previous:   
Post new topic   Reply to topic    AppletTalk.com Forum Index -> Java Help All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.