/** * Terminates the application context. * this call is the same as exit(true) */ public static void exit() { exit(true); }
/** * Terminates the application context. * this call is the same as exit(true) */ public static void exit() { exit(true); }
@Override public Object invoke(Object proxy, Method method, Object[] args) throws Throwable { boolean handled = true; String methodName = method.getName(); if (methodName.equals("handleAbout")) { Application.AboutHandler aboutHandler = (Application.AboutHandler)application; aboutHandler.aboutRequested(); } else if (methodName.equals("handleQuit")) { handled = !exit(true); } // Invoke setHandled() setHandledMethod.invoke(args[0], new Object[] {handled}); return null; } };
@Override public Object invoke(Object proxy, Method method, Object[] args) throws Throwable { boolean handled = true; String methodName = method.getName(); if (methodName.equals("handleAbout")) { Application.AboutHandler aboutHandler = (Application.AboutHandler)application; aboutHandler.aboutRequested(); } else if (methodName.equals("handleQuit")) { handled = !exit(true); } // Invoke setHandled() setHandledMethod.invoke(args[0], new Object[] {handled}); return null; } };
@Override public void processWindowEvent(WindowEvent event) { super.processWindowEvent(event); switch(event.getID()) { case WindowEvent.WINDOW_CLOSING: { exit(); break; } case WindowEvent.WINDOW_CLOSED: { System.exit(0); break; } } }
@Override public void processWindowEvent(WindowEvent event) { super.processWindowEvent(event); switch(event.getID()) { case WindowEvent.WINDOW_CLOSING: { exit(); break; } case WindowEvent.WINDOW_CLOSED: { System.exit(0); break; } default: { break; } } }