Java Swing Look and Feel isWindowsXPLookAndFeel()

Here you can find the source of isWindowsXPLookAndFeel()

Description

Determines if current L&F is Windows XP LookAndFeel

License

Open Source License

Declaration

public static boolean isWindowsXPLookAndFeel() 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.awt.Toolkit;

import javax.swing.UIManager;

public class Main {
    /**//from   ww w  .j  a  v  a 2  s . c  om
     * Determines if current L&F is Windows XP LookAndFeel
     */
    public static boolean isWindowsXPLookAndFeel() {
        if (!isWindowsLookAndFeel()) {
            return false;
        }

        // is XP theme active in the underlying OS?
        boolean xpThemeActiveOS = Boolean.TRUE
                .equals(Toolkit.getDefaultToolkit().getDesktopProperty("win.xpstyle.themeActive")); //NOI18N
        // is XP theme disabled by the application?

        boolean xpThemeDisabled = (System.getProperty("swing.noxp") != null); // NOI18N

        boolean vistaOs = System.getProperty("os.version").startsWith("6.0");

        return ((xpThemeActiveOS) && (!xpThemeDisabled) && !vistaOs);
    }

    /**
     * Determines if current L&F is WindowsLookAndFeel
     */
    public static boolean isWindowsLookAndFeel() {
        // is current L&F some kind of WindowsLookAndFeel?
        return UIManager.getLookAndFeel().getID().equals("Windows"); //NOI18N
    }
}

Related

  1. isWindowsLookAndFeel()
  2. isWindowsLookAndFeel()
  3. isWindowsModernLookAndFeel()
  4. isWindowsUI()
  5. isWindowsVistaLookAndFeel()
  6. isWinLAF()
  7. isWinLAF()
  8. isXP()
  9. listLookAndFeels()