Java Swing Look and Feel setLaf()

Here you can find the source of setLaf()

Description

set Laf

License

Open Source License

Declaration

public static void setLaf() 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.awt.Font;

import javax.swing.UIManager;
import javax.swing.UnsupportedLookAndFeelException;
import javax.swing.plaf.nimbus.NimbusLookAndFeel;

public class Main {
    public static void setLaf() {
        try {/* w  w  w .  j a va  2 s  . co  m*/
            // MetalLookAndFeel.setCurrentTheme(new RayoTheme());
            // UIManager.setLookAndFeel(RayoLookAndFeel.class.getName());
            UIManager.setLookAndFeel(NimbusLookAndFeel.class.getName());
            UIManager.put("Table.rowHeight", Integer.valueOf(25));
            NimbusLookAndFeel laf = (NimbusLookAndFeel) UIManager.getLookAndFeel();
            laf.getDefaults().put("defaultFont", new Font(Font.SANS_SERIF, Font.PLAIN, 16));
        } catch (ClassNotFoundException | InstantiationException | IllegalAccessException
                | UnsupportedLookAndFeelException e) {
            e.printStackTrace();
        }
    }
}

Related

  1. setDefaultLookAndFeel()
  2. setDefaultLookandfeel()
  3. setJavaLookAndFeel()
  4. setJavaLookAndFeel()
  5. setJavaLookAndFeel()
  6. setLAF(final String lafName)
  7. setLAF(String className)
  8. setLaf(String lafName)
  9. setLAF(String LAFName)