Originally posted by Gopu Akraju:
I am adding 5 panels in box layout. Is tehre any way I can change the height of each panel in the final diaplay. B'cos few panels contain buttons and few contain JTextArea. Right now all the panels carry equal weight or equal height. I want to reduce the height for the panel with buttons and more height for panels with JTextArea.
You don't say whether your BoxLayout uses X_AXIS or Y_AXIS, but either way I don't see why it would be giving each panel the same height unless they all had the same preferred height (by which I mean
getPreferredSize().height).
Typically a JPanel containing a JTextArea would have a larger preferred height than a JPanel containing some JButtons, so I'm not sure what to say in the absence of further details.
[edit: Actually, I take that back. The JTextArea's preferred size will be just enough to display its content, so if there's not much text in it then it's preferred size may be very small. In this case, you may want to fix this by calling setColumns()/setRows() on the JTextArea, or setPreferredSize() on the JTextArea, it's JScrollPane, or it's JPanel.]
I take it you're sure you're not actually using GridLayout somehow.
[ April 10, 2008: Message edited by: Brian Cole ]