How do I get the system look and feel?

The UIManager.getSystemLookAndFeelClassName() method return the current system look and feel for Swing application. Do not forget to call the SwingUtilities.updateComponentTreeUI() method after setting the LAF to update the current application look and feel.

package org.kodejava.example.swing;

import javax.swing.*;

public class SystemLAFDemo {
    public static void main(String[] args) {
        JFrame frame = new JFrame();
        frame.setSize(250, 250);
        frame.setTitle("System LAF Demo");

        try {
            // Use the system look and feel for the swing application
            String className = UIManager.getSystemLookAndFeelClassName();
            System.out.println("ClassName = " + className);
        } catch (Exception e) {


System LAF Demo

Wayan Saryada

Founder at Kode Java Org
I am a programmer, a runner, a recreational diver, currently live in the island of Bali, Indonesia. Mostly programming in Java, Spring Framework, Hibernate / JPA. If these posts help, you can support me, buy me a cup of coffee or tea. Thank you 🥳

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.