if (m_IOThread != null) {
if (m_IOThread == null) {
  protected void saveInstancesToFile(final File f, final Instances inst) {          if (m_IOThread != null) {      m_IOThread = new Thread() {	public void run() {	  try {	    m_Log.statusMessage("Saving to file...");	    Writer w = new BufferedWriter(new FileWriter(f));	    Instances h = new Instances(inst, 0);	    w.write(h.toString());	    w.write("\n");	    for (int i = 0; i < inst.numInstances(); i++) {	      w.write(inst.instance(i).toString());	      w.write("\n");	    }	    w.close();	  } catch (Exception ex) {	    ex.printStackTrace();	    m_Log.logMessage(ex.getMessage());	  }	  m_IOThread = null;	}      };      m_IOThread.setPriority(Thread.MIN_PRIORITY); // UI has most priority      m_IOThread.start();    } else {      JOptionPane.showMessageDialog(this,				    "Can't save at this time,\n"				    + "currently busy with other IO",				    "Save Instances",				    JOptionPane.WARNING_MESSAGE);    }  }