// set application name
System.setProperty("com.apple.mrj.application.apple.menu.about.name", title);
// create an implementation of the ApplicationListener interface
Class<?> applicationListenerInterface = Class.forName("com.apple.eawt.ApplicationListener");
Object applicationListenerInstance = Proxy.newProxyInstance(MacSupport.class.getClassLoader(), new Class<?>[] { applicationListenerInterface }, new InvocationHandler() {
@Override
public Object invoke(Object proxy, Method method, Object[] arguments) throws Throwable {
// the name of the invoked method
String methodName = method.getName();