Here you can find the source of getWindowsVisualStyle()
public static String getWindowsVisualStyle()
//package com.java2s; /*//ww w .java2s . c o m * Copyright 2004 Sun Microsystems, Inc., 4150 Network Circle, * Santa Clara, California 95054, U.S.A. All rights reserved. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ import java.awt.Toolkit; import javax.swing.UIManager; public class Main { /** * Returns the name of the current Windows visual style. * <ul> * <li>it looks for a property name "win.xpstyle.name" in UIManager and if * not found * <li>it queries the win.xpstyle.colorName desktop property ( * {@link Toolkit#getDesktopProperty(java.lang.String)}) * </ul> * * @return the name of the current Windows visual style if any. */ public static String getWindowsVisualStyle() { String style = UIManager.getString("win.xpstyle.name"); if (style == null) { // guess the name of the current XPStyle // (win.xpstyle.colorName property found in // awt_DesktopProperties.cpp in // JDK source) style = (String) Toolkit.getDefaultToolkit().getDesktopProperty("win.xpstyle.colorName"); } return style; } }