0
我想知道爲什麼我不能調整我的框架的大小,並調整框架調整大小的所有組件調整大小越來越小。謝謝!!!如何使一個Java swing JFrame正確調整大小
public class TPASimulatorGUI extends JFrame{
JPanel mainPanel = new JPanel();
BoxLayout layout = new BoxLayout(mainPanel,BoxLayout.Y_AXIS);
mainPanel.setLayout(layout);
// add things to main panel
JPanel it = new JPanel(new FlowLayout(FlowLayout.LEADING));
it.add(mainPanel);
this.getContentPane().add(it);
this.setSize(new Dimension(1190,770));
this.setVisible(true);
}