public static void close(final JGraphTab graphTab){
  final List<CGraphPanel> graphs=new ArrayList<CGraphPanel>();
  for (int i=0; i < graphTab.getTabCount(); i++) {
    graphs.add(((CGraphPanel)graphTab.getComponentAt(i)));
  }
  close(SwingUtilities.getWindowAncestor(graphTab),graphs);
}

public static void close ( final JGraphTab graphTab ) { final List < CGraphPanel > graphs = new ArrayList < CGraphPanel > ( ) ; for ( int i = 0 ; i < graphTab . getTabCount ( ) ; i ++ ) { graphs . add ( ( ( CGraphPanel ) graphTab . getComponentAt ( i ) ) ) ; } close ( SwingUtilities . getWindowAncestor ( graphTab ) , graphs ) ; }
closes a graph window . before closing the graph window , the user is asked whether he wants to save modified graphs .
