SwingUtilities.invokeAndWait(new Runnable() {
Runnable r = new Runnable() {
  public void setBaseInstances(Instances inst) {    m_BaseInstances = inst;    try {      SwingUtilities.invokeAndWait(new Runnable() {	public void run() {	  m_BaseInstPanel.setInstances(m_BaseInstances);	  m_AttPanel.setInstances(m_BaseInstances);	  m_AttSummaryPanel.setInstances(m_BaseInstances);	  m_Log.logMessage("Base relation is now "			   + m_BaseInstances.relationName()			   + " (" + m_BaseInstances.numInstances()			   + " instances)");	  m_Log.statusMessage("OK");	  setWorkingInstances(m_BaseInstances);	  m_ApplyBut.setEnabled(true);	  m_ReplaceBut.setEnabled(false);	  m_SaveBut.setEnabled(false);	}      });    } catch (Exception ex) {      JOptionPane.showMessageDialog(this,				    "Problem setting base instances:\n"				    + ex.getMessage(),				    "Instances",				    JOptionPane.ERROR_MESSAGE);    }  }