我有这段代码
//Create the single player panel
singlePlayerPanel.setLayout(new GridBagLayout());
GridBagConstraints gbc = new GridBagConstraints();
gbc.insets = new Insets(1,1,1,1);
JLabel STypeOfGameLabel = new JLabel("Type Of Game:");
gbc.gridx=0;
gbc.gridy=0;
singlePlayerPanel.add(STypeOfGameLabel,gbc);
JComboBox STypeOfGameCombobox = new JComboBox(new String[] {"Normal (12*2 cards)", "Double (24*2 cards)"});
gbc.gridx=1;
gbc.gridy=0;
singlePlayerPanel.add(STypeOfGameCombobox,gbc);
JCheckBox SShowRandomly = new JCheckBox("Show Randomly");
gbc.gridx=0;
gbc.gridy=2;
gbc.gridwidth=2;
singlePlayerPanel.add(SShowRandomly,gbc);
JCheckBox SSwap = new JCheckBox("Swap");
gbc.gridx=0;
gbc.gridy=3;
gbc.gridwidth=2;
singlePlayerPanel.add(SSwap,gbc);
JCheckBox SCertainOrder = new JCheckBox("CertainOrder");
gbc.gridx=0;
gbc.gridy=4;
gbc.gridwidth=2;
singlePlayerPanel.add(SCertainOrder,gbc);
JButton SPlay = new JButton("PLAY");
gbc.gridx=0;
gbc.gridy=5;
gbc.gridwidth=2;
gbc.gridheight=3;//DOESN'T WORK
gbc.fill=GridBagConstraints.VERTICAL;
gbc.fill=GridBagConstraints.HORIZONTAL;
singlePlayerPanel.add(SPlay,gbc);
JButton SBack = new JButton("Back");
gbc.gridx=0;
gbc.gridy=8;
gbc.gridheight=3;
singlePlayerPanel.add(SBack,gbc);
我不知道我做错了什么。如果我在任何复选框上都可以使用它,但是在这个按钮上没有。
P.S Java新手