Java Swing Look and Feel getAvailableLookAndFeels()

Here you can find the source of getAvailableLookAndFeels()

Description

Returns a list of available Swing Look and Feels

License

Mozilla Public License

Return

a collection of installed Look And Feels

Declaration

public static List<String> getAvailableLookAndFeels() 

Method Source Code


//package com.java2s;
/*//from w w w.ja va  2 s  . com
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
 */

import java.util.ArrayList;
import java.util.List;

import javax.swing.UIManager;

public class Main {
    /**
     * Returns a list of available Swing Look and Feels
     * @return a collection of installed Look And Feels
     */
    public static List<String> getAvailableLookAndFeels() {
        ArrayList<String> availableLookAndFeels = new ArrayList<>(5);

        for (UIManager.LookAndFeelInfo lafInfo : UIManager.getInstalledLookAndFeels()) {
            availableLookAndFeels.add(lafInfo.getName());
        }
        return availableLookAndFeels;
    }
}

Related

  1. computeIsLafAqua()
  2. defaultLookAndFeel()
  3. enableLafIfAvailable(String lafName)
  4. fixLnF()
  5. getAvailableLookAndFeels()
  6. getInstalledLookAndFeels()
  7. getLAF(int lafNumber)
  8. getLafClassName(String lafName)
  9. getLookAndFeel(final String displayName)