 |
AppletTalk.com Java discussions newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Guest
|
Posted: Mon Mar 20, 2006 4:12 pm Post subject: pack() on a JInternalFrame with BorderLayout does not size c |
|
|
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
|
Posted: Mon Mar 20, 2006 8:12 pm Post subject: Re: pack() on a JInternalFrame with BorderLayout does not si |
|
|
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
|
Posted: Mon Mar 20, 2006 9:12 pm Post subject: Re: pack() on a JInternalFrame with BorderLayout does not si |
|
|
<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 |
|
 |
|
|
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
|
|