Java Swing Look and Feel getLookAndFeelToSave()

Here you can find the source of getLookAndFeelToSave()

Description

Returns the name of the LookAndFeel to load RText with the next time it starts up.

License

BSD License

Return

The name of the LookAndFeel to save in the RText preferences.

Declaration

public static String getLookAndFeelToSave() 

Method Source Code

//package com.java2s;
/*//from  w w w . j ava2 s .c om
 * 03/01/2004
 *
 * RTextUtilities.java - Standard tools used by several pieces of RText.
 * Copyright (C) 2004 Robert Futrell
 * http://fifesoft.com/rtext
 * Licensed under a modified BSD license.
 * See the included license file for details.
 */

import javax.swing.UIManager;

public class Main {
    /**
     * The last LookAndFeel (attempted to be) installed.  This may not be
     * the actual currently-active LookAndFeel, if the user tries to install
     * one with different window decoration properties.
     */
    private static String currentLaF;

    /**
     * Returns the name of the LookAndFeel to load RText with the next time it
     * starts up.  This may not be the same thing as the currently active LAF,
     * if the user chose a LAF that used custom window decorations, for example.
     *
     * @return The name of the LookAndFeel to save in the RText preferences.
     */
    public static String getLookAndFeelToSave() {
        String laf = currentLaF;
        if (laf == null) {
            laf = UIManager.getLookAndFeel().getClass().getName();
        }
        return laf;
    }
}

Related

  1. getLAF(int lafNumber)
  2. getLafClassName(String lafName)
  3. getLookAndFeel(final String displayName)
  4. getLookAndFeel(String name)
  5. getLookAndFeelInfo()
  6. getNimbusLAF()
  7. getSortedInstalledLAFInfos()
  8. getSysDefLookandFeel()
  9. getSystemLAF()