Class XPUtils


  • public class XPUtils
    extends java.lang.Object
    Util class for XP style.
    • Constructor Summary

      Constructors 
      Constructor Description
      XPUtils()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.String getColorName()
      Gets the color name.
      static boolean isXPStyleOn()
      Checks if the XP style is on.
      static void main​(java.lang.String[] args)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • XPUtils

        public XPUtils()
    • Method Detail

      • isXPStyleOn

        public static boolean isXPStyleOn()
                                   throws java.lang.UnsupportedOperationException
        Checks if the XP style is on. Even on Windows XP OS, user can choose Classic style or XP style. This method will tell you if XP style is on.

        Please note it will return the correct value only if it's jdk1.4.2 and above. Otherwise it will throw UnsupportedOperationException.

        Returns:
        true if XP style in on.
        Throws:
        java.lang.UnsupportedOperationException - if jdk version is not 1.4.2 or above.
      • getColorName

        public static java.lang.String getColorName()
                                             throws java.lang.UnsupportedOperationException
        Gets the color name. On Windows XP, it could be one of the values BLUE, HOMESTEAD or METALLIC. If XP style is not on or the system is not Windows XP at all, it will return null.

        Please note it will return the correct value only if it's jdk1.4.2 and above. Otherwise it will throw UnsupportedOperationException.

        Returns:
        the color name of XP theme.
        Throws:
        java.lang.UnsupportedOperationException - if jdk version is not 1.4.2 or above.
      • main

        public static void main​(java.lang.String[] args)