@Override
	public void setProgress(int i) {
		// Need to sleep since NT4.0 doesn't share so well with threads, and it's likely that this dialog
		// is running in a different thread from the process updating things. Note: when setProgress is 
		// called it is executing in the thread from the process calling the method, not the thread the dialog
		// is in. Basically this gives swing time to updated the GUI.
		try {
			if (sleepCounter == 0) {
				Thread.sleep(10);
			} else if (sleepCounter == SLEEP_LIMIT) {
				sleepCounter = 0;
			} else {
				sleepCounter++;
			}
		} catch (Exception e) {}

		//System.out.println(getMinimum() + ":" + i + ":" + getMaximum());
		if (isVisible()) {
			if (i >= getMaximum()) {
				setCanceled(true);
				close();
			}
		}
		bar.setValue(i);
	}