Here you can find the source of prepareTheme(final String overrideEnvVar)
Parameter | Description |
---|---|
overrideEnvVar | The environment variable to check for override value. Specify null for don't use override variable |
Parameter | Description |
---|---|
Exception | When setting the theme failed |
public static void prepareTheme(final String overrideEnvVar) throws Exception
//package com.java2s; /*//from w w w . j av a 2 s. c o m * Copyright (C) 2009 Klaus Reimer <k@ailis.de> * See LICENSE.md for licensing information. */ import javax.swing.UIManager; public class Main { /** * Prepares the theme. The theme can be overridden with the specified environment variable. The default is the * system look and feel. * * @param overrideEnvVar * The environment variable to check for override value. Specify null for don't use override variable * @throws Exception * When setting the theme failed */ public static void prepareTheme(final String overrideEnvVar) throws Exception { final String sysThemeStr = overrideEnvVar == null ? null : System.getenv().get(overrideEnvVar); System.setProperty("apple.laf.useScreenMenuBar", "true"); if (sysThemeStr == null || Boolean.parseBoolean(sysThemeStr)) { UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); } } }