Workarround for a bug within OSX and java 1.7. The call to setExtendedState with both flags ICONIFY and MAXIMIED_BOTH set throws an illegal state exception.