void shutdown() {
		if (preferences != null && owner != null) {
			Rectangle bounds = owner.getBounds();
			preferences.putInt("Upper-left x", bounds.x);
			preferences.putInt("Upper-left y", bounds.y);
			MenuBar menuBar = (MenuBar) owner.getJMenuBar();
			preferences.put("Latest E2D Path", menuBar.getLatestPath("e2d"));
			preferences.put("Latest HTM Path", menuBar.getLatestPath("htm"));
			preferences.put("Latest PNG Path", menuBar.getLatestPath("png"));
			preferences.put("Latest IMG Path", menuBar.getLatestPath("img"));
			String[] recentFiles = menuBar.getRecentFiles();
			if (recentFiles != null) {
				int n = recentFiles.length;
				if (n > 0)
					for (int i = 0; i < n; i++)
						preferences.put("Recent File " + i, recentFiles[n - i - 1]);
			}
			preferences.putInt("Sensor Maximum Data Points", Sensor.getMaximumDataPoints());
		}
		MiscUtil.shutdown();
		if (launchedByJWS || "true".equalsIgnoreCase(System.getProperty("NoUpdate"))) {
			System.exit(0);
		} else {
			if (appDirectoryWritable) {
				owner.setVisible(false);
				// UpdateStub.update();
				Updater.install();
			}
			System.exit(0);
		}
	}