public void addTab(String name,Component tab){
  if (tabs.size() == 0) {
    tabbedPane.addTab(name,tab);
  }
 else {
    tabbedPane.addTab(name,new JPanel());
  }
  tabs.add(tab);
}

public void addTab ( String name , Component tab ) { if ( tabs . size ( ) == 0 ) { tabbedPane . addTab ( name , tab ) ; } else { tabbedPane . addTab ( name , new JPanel ( ) ) ; } tabs . add ( tab ) ; }
add a tab to the dialog .
