我想知道为什么我不能在下面调整我的框架大小,并且在调整框架大小时让所有组件的大小越来越小。谢谢!!!
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);
}