Example usage for javax.swing SwingUtilities updateComponentTreeUI

List of usage examples for javax.swing SwingUtilities updateComponentTreeUI

Introduction

In this page you can find the example usage for javax.swing SwingUtilities updateComponentTreeUI.

Prototype

public static void updateComponentTreeUI(Component c) 

Source Link

Document

A simple minded look and feel change: ask each node in the tree to updateUI() -- that is, to initialize its UI property with the current look and feel.

Usage

From source file:utybo.branchingstorytree.swing.OpenBSTGUI.java

private void switchLaF(int id, LookAndFeel laf) {
    try {// w  w w.  j  av  a  2  s.  c  o  m
        dark = id == 0 || ADDITIONAL_DARK_THEMES.containsValue(laf);
        UIManager.setLookAndFeel(laf);
        SwingUtilities.updateComponentTreeUI(instance);
        background.setDark(dark);
        darkModeCallbacks.forEach(a -> a.accept(dark));
        selectedTheme = id;
    } catch (UnsupportedLookAndFeelException e) {
        LOG.warn("Unsupported LaF", e);
    }
}