1 Reply Latest reply: May 21, 2013 8:58 AM by 935844 RSS

    JTree custom DefaultTreeCellRenderer with custom DefaultMutableTreeNode

    935844
      Is there a way to create my own version of DefaultTreeCellRenderer that does not use DefaultMutableTreeNode? I tried copying an example of a custom DefaultTreeCellRenderer but I can’t cast the "value" in getTreeCellRendererComponent() to my own version of DefaultMutableTreeNode.

      From the looks of the documentation below shouldn't I be able to do that?

      Component getTreeCellRendererComponent(JTree tree, Object value, boolean selected, boolean expanded, boolean leaf, int row, boolean hasFocus)