Java Utililty Methods Swing Look and Feel

List of utility methods to do Swing Look and Feel

Description

The list of methods to do Swing Look and Feel are organized into topic(s).

Method

voidsetLookAndFeel()
Setup look at feel.
if (THREAD_REPAINT_DEBUG) {
    try {
        Class<?> cls = ClassLoader.getSystemClassLoader()
                .loadClass("org.jdesktop.swinghelper.debug.CheckThreadViolationRepaintManager");
        RepaintManager.setCurrentManager((RepaintManager) cls.newInstance());
    } catch (Exception e) {
if (PREFER_GTK) {
    try {
        Toolkit toolkit = Toolkit.getDefaultToolkit();
        Class<?> suntoolkit = Class.forName("sun.awt.SunToolkit");
        Method testm = suntoolkit.getMethod("isNativeGTKAvailable");
        if (suntoolkit.isInstance(toolkit) && (Boolean) testm.invoke(toolkit)) {
            UIManager.setLookAndFeel("com.sun.java.swing.plaf.gtk.GTKLookAndFeel");
            return;
    } catch (Exception e) {
try {
    UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
} catch (Exception e) {
voidsetLookAndFeel()
Sets the LAF for the application dynamically looking for JGoodies Looks library.
if (System.getProperty("java.vendor").startsWith("Apple")) {
    if (Boolean.getBoolean("marathon.useAppleMenuBar")
            || System.getProperty("marathon.useAppleMenuBar") == null)
        System.setProperty("apple.laf.useScreenMenuBar", "true");
    return;
try {
    Class<?> classOptions = Class.forName("com.jgoodies.looks.Options");
...
voidsetLookAndFeel()
set Look And Feel
try {
    UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
} catch (Exception e1) {
    e1.printStackTrace();
voidsetLookAndFeel()
The standard look and feel for the system is used.
try {
    UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
} catch (Exception e) {
    System.err.println("Couldn't use the system look.");
voidsetLookandFeel()
set Lookand Feel
try {
    SetLookAndFeel("Metal", "Ocean");
} catch (Exception e) {
    e.printStackTrace();
voidsetLookAndFeel()
Set UI look & feel to system look & feel.
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
voidsetLookAndFeel()
set Look And Feel
if (UIManager.getLookAndFeel().getID().equals("Aqua")) { 
    SPINNERHEIGHT = 20;
} else { 
    try {
        UIManager.setLookAndFeel("com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel"); 
    } catch (Exception e) {
        try {
            UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
...
voidsetLookAndFeel()
set Look And Feel
String lafStr = System.getProperty("anidev.pcds.laf", "<nimbus>");
switch (lafStr) {
case "<nimbus>":
    lafStr = "com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel";
    break;
case "<system>":
    lafStr = UIManager.getSystemLookAndFeelClassName();
    break;
...
voidsetLookAndFeel()
Try to set the default look and feel.
try {
    UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
} catch (Exception e) {
voidsetLookAndFeel(Component comp)
set Look And Feel
if (isInEclipse()) {
    LookAndFeel oldLaF = UIManager.getLookAndFeel();
    UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
    SwingUtilities.updateComponentTreeUI(comp);
    UIManager.setLookAndFeel(oldLaF);