public void undo(){
  File file;
  ArrayList data;
  Instances inst;
  ObjectInputStream ois;
  if (m_Undo.size() == 0)   return;
  file=m_Undo.get(m_Undo.size() - 1);
  m_Undo.remove(m_Undo.size() - 1);
  try {
    ois=new ObjectInputStream(new BufferedInputStream(new FileInputStream(file)));
    data=(ArrayList)ois.readObject();
    m_CurrentFile=(File)data.get(0);
    inst=(Instances)data.get(1);
    notifyTabsDataChanged(null,inst);
  }
 catch (  Exception e) {
    handleException(null,"Failed to load undo data from '" + file + "':",e);
    JOptionPane.showMessageDialog(this,"Failed to load undo data from '" + file + "':\n"+ e,"Undo",JOptionPane.ERROR_MESSAGE);
  }
  updateMenu();
}

public void undo ( ) { File file ; ArrayList data ; Instances inst ; ObjectInputStream ois ; if ( m_Undo . size ( ) == 0 ) return ; file = m_Undo . get ( m_Undo . size ( ) - 1 ) ; m_Undo . remove ( m_Undo . size ( ) - 1 ) ; try { ois = new ObjectInputStream ( new BufferedInputStream ( new FileInputStream ( file ) ) ) ; data = ( ArrayList ) ois . readObject ( ) ; m_CurrentFile = ( File ) data . get ( 0 ) ; inst = ( Instances ) data . get ( 1 ) ; notifyTabsDataChanged ( null , inst ) ; } catch ( Exception e ) { handleException ( null , "Failed to load undo data from '" + file + "':" , e ) ; JOptionPane . showMessageDialog ( this , "Failed to load undo data from '" + file + "':\n" + e , "Undo" , JOptionPane . ERROR_MESSAGE ) ; } updateMenu ( ) ; }
undos the last operation .
