Answers for "how to align swing elements"

0

how to align swing elements

JPanel panel = new JPanel();
panel.setLayout(new BoxLayout(panel, BoxLayout.Y_AXIS));
panel.add(c1);
panel.add(c2);

c1.setAlignmentX(Component.LEFT_ALIGNMENT);
c2.setAlignmentX(Component.LEFT_ALIGNMENT);
Posted by: Guest on July-28-2021

Code answers related to "how to align swing elements"

Browse Popular Code Answers by Language