protected void addItem(JPanel p,JComponent c,int x,int y){
  GridBagConstraints gc=new GridBagConstraints();
  gc.gridx=x;
  gc.gridy=y;
  gc.weightx=100.0;
  gc.weighty=100.0;
  p.add(c,gc);
}

protected void addItem ( JPanel p , JComponent c , int x , int y ) { GridBagConstraints gc = new GridBagConstraints ( ) ; gc . gridx = x ; gc . gridy = y ; gc . weightx = 100.0 ; gc . weighty = 100.0 ; p . add ( c , gc ) ; }
add item to a panel
