public static boolean supportsTray ( ) { try { final Class trayClass = Class . forName ( "java.awt.SystemTray" ) ; final Boolean bool = ( Boolean ) trayClass . getDeclaredMethod ( "isSupported" ) . invoke ( null ) ; return bool . booleanValue ( ) ; } catch ( final Exception e ) { LOG . warn ( "Reflection error" , e ) ; return false ; } }
Uses reflection to determine whether or not this operating system and java version supports the system tray .