Here you can find the source of setExpandedIcon(JTree tree, Icon icon)
Parameter | Description |
---|---|
tree | the tree to set the expanded icon for. |
icon | the new collapsed icon to use. |
public static void setExpandedIcon(JTree tree, Icon icon)
//package com.java2s; //License from project: Open Source License import javax.swing.Icon; import javax.swing.JTree; import javax.swing.plaf.basic.BasicTreeUI; public class Main { /**//from ww w. j av a2 s.c o m * Set's the expanded icon to use for the given {@link JTree} if that * tree's UI delegate extends from {@link BasicTreeUI}. 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 expanded icon for. * @param icon the new collapsed icon to use. * @see BasicTreeUI#setExpandedIcon(javax.swing.Icon) */ public static void setExpandedIcon(JTree tree, Icon icon) { ((BasicTreeUI) tree.getUI()).setExpandedIcon(icon); } }