Я действительно не знаю, как заставить южную панель появляться без кнопок go вверх. Может быть, мне нужно изменить макет с макета границы на другой, я не знаю ...
----------> Мой код:
public class a1211 extends JFrame {
private final JButton OK;
private final JButton cancel;
private final JButton setup;
private final JButton help;
private final JPanel buttonPanel;
private final JLabel printQuality;
private final JComboBox<String> quality;
private final String[] qualityNames = { "High", "Low", "Medium" };
private final JCheckBox printToFile;
private final JPanel southPanel;
public a1211() {
super("Printer");
OK = new JButton("OK");
cancel = new JButton("Cancel");
setup = new JButton("Setup...");
help = new JButton("Help");
buttonPanel = new JPanel();
buttonPanel.setLayout(new GridLayout(4, 1, 5, 5));
buttonPanel.add(OK);
buttonPanel.add(cancel);
buttonPanel.add(setup);
buttonPanel.add(help);
printQuality = new JLabel("Print Quality:");
quality = new JComboBox<String>(qualityNames);
printToFile = new JCheckBox("Print To File");
southPanel = new JPanel();
southPanel.add(printQuality);
southPanel.add(quality);
southPanel.add(printToFile);
add(buttonPanel, BorderLayout.EAST);
add(southPanel, BorderLayout.SOUTH);
}
public static void main(String[] args) {
a1211 a1211 = new a1211();
a1211.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
a1211.setSize(400, 150);
a1211.setVisible(true);
}
}
----------> Что делает этот код:
![enter image description here](https://i.stack.imgur.com/o7z1e.jpg)
----------> Что должно быть сделано:
![https://i.stack.imgur.com/t7UWG.jpg](https://i.stack.imgur.com/t7UWG.jpg)