Мой код:
public class Form {
public static void main(String[] args) {
Form form = new Form();
form.go();
}
public void go() {
JFrame form = new JFrame();
GridLayout layout = new GridLayout(2,7);
Label nameLabel = new Label("Name");
form.setLayout(layout);
JTextField nameBox = new JTextField();
form.getContentPane().add(nameLabel);
form.getContentPane().add(nameBox);
form.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
form.setSize(500,500);
form.setVisible(true);
}
}
Теперь, как мне установить эту позицию JTextField, чтобы она составляла 2,7, а не 1,2?