Java Swing Look and Feel setLAF(String LAFName)

Here you can find the source of setLAF(String LAFName)

Description

set LAF

License

Open Source License

Declaration

private static void setLAF(String LAFName) throws ClassNotFoundException, IllegalAccessException,
            UnsupportedLookAndFeelException, InstantiationException 

Method Source Code


//package com.java2s;
/*/*from   www  .  jav a2 s .c  om*/
 * Copyright (c) 2013, Bui Nguyen Thang, thang.buinguyen@gmail.com, thangbui.net. All rights reserved.
 * Licensed under the GNU General Public License version 2.0 (GPLv2)
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html
 */

import javax.swing.*;

public class Main {
    private static void setLAF(String LAFName) throws ClassNotFoundException, IllegalAccessException,
            UnsupportedLookAndFeelException, InstantiationException {
        for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
            if (LAFName.equals(info.getName())) {
                javax.swing.UIManager.setLookAndFeel(info.getClassName());
                break;
            }
        }
    }
}

Related

  1. setJavaLookAndFeel()
  2. setJavaLookAndFeel()
  3. setLaf()
  4. setLAF(final String lafName)
  5. setLAF(String className)
  6. setLaf(String lafName)
  7. setLAFNimbus()
  8. setLookAndFeel()
  9. setLookAndFeel()