Java Utililty Methods JTree Color

List of utility methods to do JTree Color

Description

The list of methods to do JTree Color are organized into topic(s).

Method

ColorgetTreeBackground()
get Tree Background
return UIManager.getColor("Tree.background");
voidsetComponentTreeBackground(Component c, Color color)
Sets the background for an entire component hierarchy to the specified color.
c.setBackground(color);
Component[] children = getChildren(c);
if (children != null) {
    for (int i = 0; i < children.length; i++) {
        setComponentTreeBackground(children[i], color);
voidupdateAllComponentTreeUIs()
Updates the componentTreeUI of all top-level windows of the current application.
for (Frame frame : Frame.getFrames()) {
    updateAllComponentTreeUIs(frame);
voidupdateComponentTreeUI(Component c)
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.
updateComponentTreeUI0(c);
c.invalidate();
c.validate();
c.repaint();
voidupdateComponentTreeUI(JComponent c)
update Component Tree UI
if (c != null) {
    SwingUtilities.updateComponentTreeUI(c);
voidupdateComponentTreeUI(Window window)
update Component Tree UI
SwingUtilities.updateComponentTreeUI(window);
for (Window w : window.getOwnedWindows())
    updateComponentTreeUI(w);
voidupdateComponentTreeUI0(Component c)
Repaints UI tree recursively.
if (c instanceof JComponent) {
    JComponent jc = (JComponent) c;
    jc.invalidate();
    jc.validate();
    jc.repaint();
    JPopupMenu jpm = jc.getComponentPopupMenu();
    if (jpm != null && jpm.isVisible() && jpm.getInvoker() == jc) {
        updateComponentTreeUI(jpm);
...