From 621737ca524be8ba97b06acba0625e66d34f7a8f Mon Sep 17 00:00:00 2001 From: teo_sarca Date: Sat, 28 Apr 2007 12:16:18 +0000 Subject: [PATCH] [ 1684168 ] Closing the application is not consistent http://sourceforge.net/tracker/index.php?func=detail&aid=1684168&group_id=176962&atid=879332 --- client/src/org/compiere/apps/AMenu.java | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/client/src/org/compiere/apps/AMenu.java b/client/src/org/compiere/apps/AMenu.java index 20975e0902..86347d4f6e 100644 --- a/client/src/org/compiere/apps/AMenu.java +++ b/client/src/org/compiere/apps/AMenu.java @@ -67,8 +67,23 @@ public final class AMenu extends CFrame System.exit(1); MSession.get (Env.getCtx(), true); // Start Session + // Setting close operation/listner - teo_sarca [ 1684168 ] + setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE); + addWindowListener(new WindowListener() { + public void windowClosing(WindowEvent e) { + if (!ADialog.ask(0, null, "ExitApplication?")) + return; + dispose(); + } + public void windowActivated(WindowEvent e) {} + public void windowClosed(WindowEvent e) {} + public void windowDeactivated(WindowEvent e) {} + public void windowDeiconified(WindowEvent e) {} + public void windowIconified(WindowEvent e) {} + public void windowOpened(WindowEvent e) {} + }); + // Preparation - setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); wfActivity = new WFActivity(this); wfPanel = new WFPanel(this); treePanel = new VTreePanel (m_WindowNo, true, false); // !editable & hasBar