code: protected void setApplicationEventHandled(Object event, boolean handled) {
          if (event != null) {
              try {
                  Method setHandledMethod = event.getClass().getDeclaredMethod("setHandled", new Class[] { boolean.class });
                  // If the target method returns a boolean, use that as a hint
                  setHandledMethod.invoke(event, new Object[] { Boolean.valueOf(handled) });
              } catch (Exception ex) {
                  System.err.println("OSXAdapter was unable to handle an ApplicationEvent: " + event);
                  ex.printStackTrace();
              }
          }
      }
docs: This method checks for a boolean result from the proxy method and sets the event accordingly