Enabling tooltips on a JTree
12-Aug-08Thinks i keep forgetting. Today: Enabling a JTree in J2SE to show different tooltips on his nodes: 1. Create a custom tree renderer like so: import java.awt.Component; import javax.swing.JTree; import javax.swing.tree.DefaultMutableTreeNode; import javax.swing.tree.DefaultTreeCellRenderer; public class TooltipTreeRenderer extends DefaultTreeCellRenderer { @Override public Component getTreeCellRendererComponent(JTree tree, Object value, boolean sel, boolean expanded, boolean leaf, int […]