private JPanel createMainPanel(){
  JPanel panel=new JPanel();
  panel.setLayout(new GridBagLayout());
  GridBagConstraints c=new GridBagConstraints();
  c.anchor=GridBagConstraints.WEST;
  c.fill=GridBagConstraints.HORIZONTAL;
  c.gridheight=1;
  c.gridwidth=GridBagConstraints.RELATIVE;
  c.insets=LABEL_INSETS;
  c.gridx=0;
  c.gridy=0;
  c.weightx=0.33f;
  c.weighty=0;
  panel.add(new JLabel("Pixel matrix"),c);
  c.insets=FIELD_INSETS;
  c.gridx=1;
  c.weightx=0.66f;
  panel.add(pixelMatrices,c);
  c.gridwidth=GridBagConstraints.REMAINDER;
  c.gridx=0;
  c.gridy++;
  c.weightx=1.0f;
  pixelMatrixEditorPlaceholder.add("Center",pixelMatrixEditor.getEditorComponent());
  panel.add(pixelMatrixEditorPlaceholder,c);
  c.anchor=GridBagConstraints.NORTHWEST;
  c.fill=GridBagConstraints.BOTH;
  c.insets=EMPTY_INSETS;
  c.gridy++;
  c.weighty=1.0f;
  panel.add(Box.createGlue(),c);
  return panel;
}

private JPanel createMainPanel ( ) { JPanel panel = new JPanel ( ) ; panel . setLayout ( new GridBagLayout ( ) ) ; GridBagConstraints c = new GridBagConstraints ( ) ; c . anchor = GridBagConstraints . WEST ; c . fill = GridBagConstraints . HORIZONTAL ; c . gridheight = 1 ; c . gridwidth = GridBagConstraints . RELATIVE ; c . insets = LABEL_INSETS ; c . gridx = 0 ; c . gridy = 0 ; c . weightx = 0.33f ; c . weighty = 0 ; panel . add ( new JLabel ( "Pixel matrix" ) , c ) ; c . insets = FIELD_INSETS ; c . gridx = 1 ; c . weightx = 0.66f ; panel . add ( pixelMatrices , c ) ; c . gridwidth = GridBagConstraints . REMAINDER ; c . gridx = 0 ; c . gridy ++ ; c . weightx = 1.0f ; pixelMatrixEditorPlaceholder . add ( "Center" , pixelMatrixEditor . getEditorComponent ( ) ) ; panel . add ( pixelMatrixEditorPlaceholder , c ) ; c . anchor = GridBagConstraints . NORTHWEST ; c . fill = GridBagConstraints . BOTH ; c . insets = EMPTY_INSETS ; c . gridy ++ ; c . weighty = 1.0f ; panel . add ( Box . createGlue ( ) , c ) ; return panel ; }
create and return the main panel .
