Это реализация, использующая jgoodies формы FormLayout (библиотека от Google):
import com.jgoodies.forms.layout.CellConstraints;
import com.jgoodies.forms.layout.FormLayout;
import javax.swing.*;
import java.awt.*;
public class FormSample {
private static JPanel generatePanel() {
FormLayout layout = new FormLayout(
"3dlu, 15dlu, max(50dlu;p), 2dlu, p, 3dlu", // column definition
"5dlu, p, 2dlu, p, 2dlu, p, 2dlu, p, 2dlu, p, 2dlu, p, 2dlu, p, 2dlu, p, 5dlu" // row definition
);
JPanel panel = new JPanel(layout);
CellConstraints cc = new CellConstraints();
int row = 0;
panel.add(new JLabel("Amplitude"), cc.xyw(2, row * 4 + 2, 4));
panel.add(new JTextField(), cc.xy(3, row * 4 + 4));
panel.add(new JLabel("V"), cc.xy(5, row * 4 + 4));
row++;
panel.add(new JLabel("Off-set"), cc.xyw(2, row * 4 + 2, 4));
panel.add(new JTextField(), cc.xy(3, row * 4 + 4));
panel.add(new JLabel("V"), cc.xy(5, row * 4 + 4));
row++;
panel.add(new JLabel("Frequentie"), cc.xyw(2, row * 4 + 2, 4));
panel.add(new JTextField(), cc.xy(3, row * 4 + 4));
panel.add(new JLabel("Hz"), cc.xy(5, row * 4 + 4));
row++;
panel.add(new JLabel("Fase"), cc.xyw(2, row * 4 + 2, 4));
panel.add(new JTextField(), cc.xy(3, row * 4 + 4));
panel.add(new JLabel("rad"), cc.xy(5, row * 4 + 4));
return panel;
}
public static void main(String[] args) {
// create frame
JFrame frame = new JFrame("Test");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
// add content panel
frame.setContentPane(generatePanel());
// shring/expand to optimal size
frame.pack();
// center frame
Toolkit toolkit = Toolkit.getDefaultToolkit();
Dimension resolution = toolkit.getScreenSize();
Dimension frameSize = frame.getSize();
int xLocation = resolution.width / 2 - frameSize.width / 2;
int yLocation = resolution.height / 2 - frameSize.height / 2;
frame.setLocation(xLocation, yLocation);
// show frame
frame.setVisible(true);
}
}