public Component add(Component component){
  gridbag.setConstraints(component,c);
  return super.add(component);
}

public Component add ( Component component ) { gridbag . setConstraints ( component , c ) ; return super . add ( component ) ; }
overridden add method that takes care of gridbaglayout constraints .
