Laying Out Components in a Row or Column // Use Y_AXIS for a vertical column. Box box = new Box(BoxLayout.X_AXIS); box.add(component1); box.add(component2);