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

voidsetMotifLookAndFeel()
set Motif Look And Feel
try {
    UIManager.setLookAndFeel("com.sun.java.swing.plaf.motif.MotifLookAndFeel");
} catch (Exception e) {
    System.out.println("Error setting Motif LAF: " + e);
voidsetMotifLookAndFeel()
Old Skool Look and Feel.
try {
    UIManager.setLookAndFeel("com.sun.java.swing.plaf.motif.MotifLookAndFeel");
} catch (Exception e) {
    System.out.println("Error setting Motif LAF: " + e);
voidsetNativeLookAndFeel()
Sets the look and feel to the system's look and feel.
try {
    UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
} catch (Exception ex) {
voidsetNativeLookAndFeel()
set Native Look And Feel
UIManager.put("Slider.paintValue", false);
try {
    UIManager.setLookAndFeel("com.sun.java.swing.plaf.gtk.GTKLookAndFeel");
    return;
} catch (Exception e) {
try {
    UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
...
voidsetNiceSwingLookAndFeel()
set Nice Swing Look And Feel
try {
    for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
        if (javax.swing.UIManager.getSystemLookAndFeelClassName().equals(info.getClassName())) {
            javax.swing.UIManager.setLookAndFeel(info.getClassName());
        if ("com.sun.java.swing.plaf.gtk.GTKLookAndFeel".equals(info.getClassName())) {
            javax.swing.UIManager.setLookAndFeel(info.getClassName());
            break;
...
booleansetNimbusLookAndFeel()
Tries to set the NimbusLookAndFeel
boolean isNumbusSet = true;
try { 
    UIManager.setLookAndFeel("com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel");
} catch (ClassNotFoundException e) {
    isNumbusSet = false;
} catch (InstantiationException e) {
    isNumbusSet = false;
} catch (IllegalAccessException e) {
...
voidsetNimbusLookAndFeel()
set Nimbus Look And Feel
try {
    for (LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) {
        if ("Nimbus".equals(info.getName())) {
            UIManager.setLookAndFeel(info.getClassName());
            break;
} catch (Exception e) {
...
voidsetSOMToolboxLookAndFeel()
set SOM Toolbox Look And Feel
try {
    UIManager.setLookAndFeel("com.jgoodies.plaf.plastic.PlasticLookAndFeel");
} catch (Exception e) {
    try {
        Logger.getLogger("at.tuwien.ifs.somtoolbox")
                .info("Could not find JGoodies Look & Feel - defaulting to cross-platform Look & Feel.");
        UIManager.setLookAndFeel(UIManager.getCrossPlatformLookAndFeelClassName());
    } catch (Exception e2) {
...
voidsetSystemLAF()
set System LAF
try {
    UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
} catch (ClassNotFoundException e) {
    e.printStackTrace();
} catch (InstantiationException e) {
    e.printStackTrace();
} catch (IllegalAccessException e) {
    e.printStackTrace();
...
booleansetSystemLAF()
Sets the system look and feel.
try {
    UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
} catch (ClassNotFoundException e) {
    return false;
} catch (InstantiationException e) {
    return false;
} catch (IllegalAccessException e) {
    return false;
...