Hi Stuart,

TreeView uses an implementation of the org.apache.pivot.collections.List 
interface as a model. Nested Lists represent branches, and non-lists represent 
leaves. So, you can simply use the List methods to add and remove tree nodes.

How nodes are presented is up to the TreeView's renderer. Pivot includes a 
default renderer called TreeViewNodeRenderer that is capable of presenting 
instances of org.apache.pivot.wtk.content.TreeNode. This class represents a 
leaf and provides text and icon properties. A subclass, TreeBranch, implements 
the List interface and serves as a branch. However, you can easily define your 
own renderer and leaf/branch classes if you prefer.

Greg


On Feb 3, 2010, at 7:21 PM, Stuart White wrote:

> I am new to Pivot and am struggling to understand how I
> programmatically add/remove a TreeView's nodes.  Can someone point me
> to some example code demonstrating this?  Thanks!

Reply via email to