Questions tagged [boxlayout]

BoxLayout is a Java Swing layout manager that allows multiple components to be laid out either vertically or horizontally.

BoxLayout is a layout manager that allows multiple components to be laid out either vertically or horizontally. The components will not wrap so, for example, a vertical arrangement of components will stay vertically arranged when the frame is resized.

enter image description here

Nesting multiple panels with different combinations of horizontal and vertical gives an effect similar to GridBagLayout, without the complexity. The diagram shows two panels arranged horizontally, each of which contains 3 components arranged vertically.

For examples and more details refer to How to Use BoxLayout tutorial.

347 questions
-2
votes
1 answer

2 Layouts for JPanel?

I am making a gui for a program and it uses JPanels to do so. I have 2 JPanels. The first one contains a JLabel, and JTextField. The second one contains a JLabel and JTextField. I need both of those at the bottom of the screen, one on top of the…
-2
votes
1 answer

Boxlayout can't be shared AWTError... recorrecting my previous quest which had Nullpointerexception am getting this error.. Please help me out

Possible Duplicate: Please help me to sort out this java.awt.BoxLayout can't be shared or NullPointerException Exception in thread "main" java.awt.AWTError: BoxLayout can't be shared at javax.swing.BoxLayout.checkContainer(BoxLayout.java:445) at…
1 2 3
23
24