progressModel.setValue(searchModel.getPageCount());
	public void update(Observable o, Object arg) {		if (o == searchModel && !searchingResults) {			searchingResults = true;			resultsPanel.removeAll();			progressModel.setValue(0);			progressModel.setMin(0);			progressModel.setMax(searchModel.getPageCount());			progressModel.setVisible(true);			new Thread(new Runnable() {				public void run() {					try {						for (int i = 1; i <= searchModel.getPageCount(); i++) {							final ImageData[] thumbs = searchModel.getPage(i);							final int page = i;							EventQueue.invokeLater(new Runnable() {								public void run() {									ResultsPanel.this.addImages(thumbs);									progressModel.setValue(page);								}							});						}					} catch (final IOException e) {						EventQueue.invokeLater(new Runnable() {							public void run() {								JOptionPane.showMessageDialog(ResultsPanel.this,										e.getMessage(), "Error", JOptionPane.ERROR_MESSAGE);							}						});					} finally  {						ResultsPanel.this.searchingResults = false;						EventQueue.invokeLater(new Runnable() {							public void run() {								progressModel.setVisible(false);									revalidate();								repaint();							}						});					}				}			}).start();		}		else if (o == fullSizeImgModel) {			fullSizePanel.setImage(null);			if (fullSizeImgModel.getImageData() == null) {				cardLayout.show(centerPanel, "results");			} else {				fsProgressBar.setVisible(true);				cardLayout.show(centerPanel, "fullSize");				new Thread(new Runnable() {					public void run() {						final long startMillis = System.currentTimeMillis();						lastFullSizeStartMillis = startMillis;						try {							URL url = fullSizeImgModel.getImageData().getUrl();							final ImageData id = ImageData.loadUrl(url);							EventQueue.invokeLater(new Runnable() {								public void run() {									if (startMillis >= lastFullSizeStartMillis)										fullSizePanel.setImage(id);								}							});						} catch (IOException e) {							JOptionPane.showMessageDialog(ResultsPanel.this.getParent(),									"Cannot load full size image: " + e.getMessage(), "Error", JOptionPane.ERROR_MESSAGE);							EventQueue.invokeLater(new Runnable() {								public void run() {									fullSizeImgModel.setImageData(null);								}							});						} finally {							EventQueue.invokeLater(new Runnable() {								public void run() {									fsProgressBar.setVisible(false);								}							});						}					}				}).start();			}		}	}