@Override public void stateChanged(ChangeEvent e){
  updateFrameTitle();
  updateMenu();
  if (e.getSource() instanceof JComponent) {
    setTabTitle((JComponent)e.getSource());
  }
}

@ Override public void stateChanged ( ChangeEvent e ) { updateFrameTitle ( ) ; updateMenu ( ) ; if ( e . getSource ( ) instanceof JComponent ) { setTabTitle ( ( JComponent ) e . getSource ( ) ) ; } }
invoked when the target of the listener has changed its state .
