browser.addWindowListener(new WindowAdapter() {
@Override
public void windowClosing(WindowEvent e) {
int value = JOptionPane.showConfirmDialog(browser, "Are you sure you want to exit?", appName, JOptionPane.YES_NO_OPTION);
if (value == JOptionPane.YES_OPTION) {
browser.dispose();
EventBus.publish(new ExitApplicationMessage() );
}
}
});