Java JTree Color updateAllComponentTreeUIs()

Here you can find the source of updateAllComponentTreeUIs()

Description

Updates the componentTreeUI of all top-level windows of the current application.

License

Open Source License

Declaration

public static void updateAllComponentTreeUIs() 

Method Source Code

//package com.java2s;
/*/*from  ww  w.  j  a  v  a  2s  . c o  m*/
 * #%L
 * The AIBench Plugin Manager Plugin
 * %%
 * Copyright (C) 2006 - 2016 Daniel Glez-Pe?a and Florentino Fdez-Riverola
 * %%
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as
 * published by the Free Software Foundation, either version 3 of the
 * License, or (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Lesser Public License for more details.
 * 
 * You should have received a copy of the GNU General Lesser Public
 * License along with this program.  If not, see
 * <http://www.gnu.org/licenses/lgpl-3.0.html>.
 * #L%
 */

import java.awt.Frame;
import java.awt.Window;

import javax.swing.SwingUtilities;

public class Main {
    /**
     * Updates the componentTreeUI of all top-level windows of the 
     * current application.
     * 
     */
    public static void updateAllComponentTreeUIs() {
        for (Frame frame : Frame.getFrames()) {
            updateAllComponentTreeUIs(frame);
        }

    }

    /**
     * Updates the componentTreeUI of the given window and all its
     * owned windows, recursively.
     * 
     * 
     * @param window the window to update
     */
    public static void updateAllComponentTreeUIs(Window window) {
        SwingUtilities.updateComponentTreeUI(window);
        for (Window owned : window.getOwnedWindows()) {
            updateAllComponentTreeUIs(owned);
        }
    }
}

Related

  1. getTreeBackground()
  2. setComponentTreeBackground(Component c, Color color)
  3. updateComponentTreeUI(Component c)
  4. updateComponentTreeUI(JComponent c)
  5. updateComponentTreeUI(Window window)
  6. updateComponentTreeUI0(Component c)