How to align elements 2 by 2 to the left in Java?

38 Views Asked by At

I am trying to make a JTabbedPane with the first tab with the following components aligned to the left but I can't get them to be left aligned 2 by 2 and at the moment it would be a JLabel + JTextField "line break" JLabel + JTextField...

1

There are 1 best solutions below

0
midugh On

Swing provides predefined layouts for common-use purposes. The one you might be looking for is java.awt.GridLayout. Take a look at the documentation for further information.