this.setSize(700,500);
this.setLayout(new BorderLayout());
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
this.setIconImage(frameIcon.getImage());
this.setTitle("Rifle Reload Logger v1.0");
this.setMinimumSize(new Dimension(700,500));
/*
* The center panel of the JFrame will be used to display the current information
* as needed whether it be for showing the file chooser, or the reload data.*/
center.setVisible(true);
center.setLayout(new GridLayout(6,4));
this.add(center, BorderLayout.CENTER);
setGUILabels();//sets the labels for the entire Gui.
基本上我的问题是我的GridLayout没有创建我要求它的6x4大小。它是一个6x3大小,这是一个图像。 Improper gridlayout.
答案 0 :(得分:1)
您只向中心JPanel添加了18个组件,而不是24个。如果您想要4列和可变数量的行,请将GridLayout设置为new GridLayout(0, 4)
。