code: static public GridBagConstraints getConstraints(int gridx, int gridy) {
          GridBagConstraints gc = new GridBagConstraints();
          gc.fill = GridBagConstraints.BOTH;
          gc.gridx = gridx;
          gc.gridy = gridy;
          return gc;
      }
docs: getConstraints, This returns a grid bag constraints object that can be used for placing a
  component appropriately into a grid bag layout.