frame.setLayout(new GridBagLayout()); //Set GridBagLayout for frame
pane.setLayout(new GridBagLayout()); //Set GridBagLayout for Panel
JPanel pane = new JPanel(new GridBagLayout()); //Set GridBagLayout for Panel
GridBagConstraints c = new GridBagConstraints() //Initialize a GridBagConstraint
...