Java JTree setLeftChildIndent(JTree tree, int indent)

Here you can find the source of setLeftChildIndent(JTree tree, int indent)

Description

Set's the left indent in pixels to use for the given JTree 's collapsed and expanded icon.

License

Open Source License

Parameter

Parameter Description
tree the tree to set the left indent for.
indent the new left indent in pixels.

Declaration

public static void setLeftChildIndent(JTree tree, int indent) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import javax.swing.JTree;

import javax.swing.plaf.basic.BasicTreeUI;

public class Main {
    /**//from   w  w w  .  j  av a 2  s  . c  o m
     * Set's the left indent in pixels to use for the given {@link JTree}'s
     * collapsed and expanded icon. This value in conjuction with the right
     * indent comprises the total amount of space that the collapsed and
     * expanded icon draw into. If the given tree's UI delegate does not extend
     * from {@code BasicTreeUI} then the given tree will not be changed.
     *
     * @param tree   the tree to set the left indent for.
     * @param indent the new left indent in pixels.
     * @see BasicTreeUI#setLeftChildIndent(int)
     */
    public static void setLeftChildIndent(JTree tree, int indent) {
        ((BasicTreeUI) tree.getUI()).setLeftChildIndent(indent);
    }
}

Related

  1. saveExpansionStateStrings(JTree tree)
  2. saveTreeSelection(JTree tree)
  3. scrollToSelection(JTree tree)
  4. scrollTreeToSelectedRow(final JTree tree)
  5. setComponentTreeEnabled(Component c, boolean enabled)
  6. setToolTipOnTree(Container c, String tooltip)
  7. setTreeEnabled(Container container, boolean enabled)
  8. treeListen(final ActionListener listener)
  9. upMove(JTree tree)