Remember two or three years ago, when the Java interface was found, if the current interface layout is set to NULL, due to the different themes of Windows, the title bar height inconsistency, resulting in inconsistent performance of the current interface.
At that time, I wanted to find a way to determine whether the current user's theme is classic style or XP style, but has not been found.
There is no intention of discovering a piece of code in the Com.sun.java.swing.plaf.windows.StyleXP class today:
/**Get The Singleton instance of this class * *@returnThe singleton instance of this class or null if XP styles * was not active or if this is not Windows XP */ Static synchronizedXpstyle Getxp () {if(Themeactive = =NULL) {Toolkit Toolkit=Toolkit.getdefaulttoolkit (); Themeactive=(Boolean) Toolkit.getdesktopproperty ("Win.xpstyle.themeActive"); if(Themeactive = =NULL) {themeactive=Boolean.false; } if(Themeactive.booleanvalue ()) {getpropertyaction propertyaction=NewGetpropertyaction ("Swing.noxp"); if(accesscontroller.doprivileged (propertyaction) = =NULL&&themereader.isthemed ()&&!(Uimanager.getlookandfeel ()instanceofWindowsclassiclookandfeel)) {XP=NewXpstyle (); } } } returnXP; }
The original Toolkit.getdefaulttoolkit (). Getdesktopproperty ("Win.xpstyle.themeActive") method is used to return the current theme style.
2007-07-04
Java: Determine whether the current operating system interface is themed with Windows Classic or XP style