constraints.gridwidth = GridBagConstraints.REMAINDER; constraints.gridheight = 1; layout.setConstraints(button8, constraints); add(button8);