Proper manner create Class, JTree, DefaultTreeCellRenderer using JTextPane
问题 I have this class in order to show multiple colors in a leaf using JTree... The class is TextPaneDefaultTreeCellRenderer import java.awt.*; import java.util.*; import javax.swing.*; import javax.swing.text.*; import javax.swing.tree.*; public class TextPaneDefaultTreeCellRenderer extends DefaultTreeCellRenderer { TextPaneTreeCellRenderer textPaneScrollPane = new TextPaneTreeCellRenderer(); public TextPaneDefaultTreeCellRenderer() { initialize(); } private void initialize() {