Layout Manager problem with Swing

Please support our Java advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: Sep 2008
Posts: 1,597
Reputation: BestJewSinceJC is a name known to all BestJewSinceJC is a name known to all BestJewSinceJC is a name known to all BestJewSinceJC is a name known to all BestJewSinceJC is a name known to all BestJewSinceJC is a name known to all 
Solved Threads: 202
BestJewSinceJC BestJewSinceJC is offline Offline
Posting Virtuoso

Layout Manager problem with Swing

 
0
  #1
Apr 26th, 2009
I'm using netbeans and I have a problem. I'm using a card layout to flip between multiple windows. Two of these windows are wider than the others, and this cannot really be helped. Ideally, it would be best to design each window so that they are all the same size, but it is impossible in this case, due to the types of information. Anyway, I can't figure out how to make them resize themselves at runtime based on which window is selected. I have the following hierarchy:

JFrame
JTabbedPane
JPanel 1 (as one of the tabs, this JPanel contains the card layout)
JPanel 2 (this is inside JPanel 1, and contains the combo box which decides what window to flip to)
JPanel (this is inside JPanel 1, and contains the windows that are flipped between)


I've tried explicitly setting the size, starting with the topmost component (the JFrame), then resizing each of the things underneath. No luck, it just ignores me and does not change the size of anything except the JFrame.

Edit:

Yeah, I don't know what I'm going to do. Since the top level container is the only thing stopping the lower ones from resizing, resizing from the top down should be working. So I guess it's the layout manager which is stopping things from being resized. Hm.
Last edited by BestJewSinceJC; Apr 26th, 2009 at 4:57 pm.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the Java Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC