JOptionPane.INFORMATION_MESSAGE) != JOptionPane.YES_OPTION) {
return;
}
}
final JWindow progressWindow = new JWindow();
final ProgressPanel panel = new ProgressPanel(1, 3, "Shutting down");
progressWindow.getContentPane().add(panel);
progressWindow.pack();
Point p = new Point(getLocation());
p.move((int) getSize().getWidth() >> 1, (int) getSize().getHeight() >> 1);
progressWindow.setLocation(p);
progressWindow.setVisible(true);
Runnable runnable =
new Runnable() {
public void run() {
try {
int progress = 1;
final int delay = 25;
handler.close();
panel.setProgress(progress++);
Thread.sleep(delay);
pluginRegistry.stopAllPlugins();
panel.setProgress(progress++);
Thread.sleep(delay);
panel.setProgress(progress++);
Thread.sleep(delay);
} catch (Exception e) {
e.printStackTrace();
}
fireShutdownEvent();
performShutdownAction();
progressWindow.setVisible(false);
}
};
new Thread(runnable).start();
}