java - Swing on OSX: How to Trap command-Q? -
after being convinced ("schooled") swing apps on mac native, i'm trying make mine native possible. looks great, when hit command+q or menu, windowstatechanged(windowevent e)
not firing on main jframe (if exit in other way, fire). how can respond real apple quit?
the top voted answer excellent fill in "best way":
system.setproperty("apple.eawt.quitstrategy", "close_all_windows");
this trigger standard window closing callback event should work nicely portable code.
as result of discussion below seems crucial in app. wrote in static initializer of main class before ui code executed.
Comments
Post a Comment