public Object invoke(Object proxy, Method method, Object[] args) {

            String methodName = method.getName();
            ActionEvent event = new ActionEvent(this, 0, methodName);

            if (methodName.equals("handleQuit")) {
                // fire the action
                if(quitListener != null) {
                    quitListener.actionPerformed(event);
                }
                else {
                    System.exit(0); //default to SystemExit
                }
            }
            else if(methodName.equals("handleAbout")) {
                // fire the action
                if(aboutListener != null) {
                    aboutListener.actionPerformed(event);
                }
            }
            else if(methodName.equals("handlePreferences")) {
                // fire the action
                if(prefListener != null) {
                    prefListener.actionPerformed(event);
                }
            }


            // Mark the ApplicationEvent as being handled.
            try {
                this.setHandledMethod.invoke(args[0],
                        new Object[]{Boolean.TRUE});
            } catch (Exception invokeEx) {
                invokeEx.printStackTrace();
            }

            return null; // All signatures in ApplicationListener return void.
        }