private void handleWindowClosed(GenericFrame localOrRemote,
final ControlPanelInfo info)
{
if (info.getServerDescriptor() == null)
{
MainMenuBar menuBar = new MainMenuBar(info);
// Assume that the user decided to quit the application
menuBar.quitClicked();
}
updateSharedLocalOrRemotePanel(localOrRemote, info);
// To be sure that the dialog receives the new configuration event before
// calling pack.
SwingUtilities.invokeLater(new Runnable()
{
public void run()
{
// Create and set up the content pane.
controlCenterPane = new ControlCenterMainPane(info);
// Create and set up the window.
dlg = Utilities.createFrame();
dlg.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
final MainMenuBar menuBar = new MainMenuBar(info);
dlg.addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent e) {
menuBar.quitClicked();
}
});
dlg.setJMenuBar(menuBar);
String title = Utils.getCustomizedObject(
"INFO_CONTROL_PANEL_TITLE",