}
} else { progressModel.setMin(0); progressModel.setMax(searchModel.getPageCount() + 1); progressModel.setValue(0); progressModel.setVisible(true); new Thread(new Runnable() { public void run() { for (int i = 1; i <= searchModel.getPageCount(); i++) { searchModel.reorderPage(i); EventQueue.invokeLater(new Runnable() { public void run() { progressModel.incrementValue(); } }); } EventQueue.invokeLater(new Runnable() { public void run() { searchModel.mergeReorderedPages(); progressModel.incrementValue(); progressModel.setVisible(false); } }); } }).start(); }
	public void actionPerformed(ActionEvent e) {		if (e.getActionCommand().equals("useFirst")) {			new Thread(new Runnable() {				public void run() {					try {						final ImageData[] examples = searchModel.getPage(1);						EventQueue.invokeLater(new Runnable() {							public void run() {								for (int i = 0; i < examples.length; i++)									examplesModel.addExample(examples[i]);							}						});					} catch (IOException e1) {						e1.printStackTrace();					}				}			}).start();		} else if (e.getActionCommand().equals("clear")) {			examplesModel.clear();		} // TODO: else...	}