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

voidsetSystemLaF()
Tries to set the system LaF, silently ignores all errors.
try {
    UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
} catch (Throwable t) {
voidsetSystemLookAndFeel()
set System Look And Feel
try {
    UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
} catch (Exception e) {
    e.printStackTrace();
voidsetSystemLookAndFeel()
set System Look And Feel
try {
    UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
} catch (UnsupportedLookAndFeelException | ClassNotFoundException | InstantiationException
        | IllegalAccessException e) {
voidsetSystemLookAndFeel()
set System Look And Feel
if (isWindows()) {
    setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
} else if (isMac()) {
    setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
} else {
    setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
booleansetSystemLookAndFeel()
Tries to set the LookAndFeel to the os default
boolean isSystemLookAndFeelSet = true;
try {
    UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
} catch (Exception e) {
    isSystemLookAndFeelSet = false;
return isSystemLookAndFeelSet;
voidsetSystemLookAndFeel(Component c)
Set the look and feel of the specified component to the style of the current system.
try {
    UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
    SwingUtilities.updateComponentTreeUI(c);
    c.validate();
} catch (Exception e) {
    e.printStackTrace();
voidsetSystemLookAndFeel(Component comp, String lookAndFeelStr)
set System Look And Feel
try {
    UIManager.setLookAndFeel(lookAndFeelStr);
    SwingUtilities.updateComponentTreeUI(comp);
} catch (Exception e) {
    return;
voidsetWindowsLook()
Changes look-and-feel to Windows look
try {
    UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
} catch (Exception e) {
    throw new RuntimeException("Change of look&feel failed.", e);
booleansetWindowsLookAndFeel()
Set look and feel of windows
try {
    UIManager.setLookAndFeel(LOOK_AND_FEEL_WINDOWS);
    return true;
} catch (Exception e) {
    return false;
voidsetWindowsLookLike(Window window)
Set the specified window to the style of WindowsTM system.
try {
    UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
    SwingUtilities.updateComponentTreeUI(window);
    window.validate();
} catch (Exception e) {
    e.printStackTrace();