Developing with the SDK > Using and Writing Data Models > NonJavaBeans Example: Abstract Model Variant > The Swing JTree

The data to be displayed is the contents of a Swing JTree. The example simply uses the contents of a default JTree, which contains names of various colors, sports and food. You create the JTree object as shown in Code Sample 2.12.

TreeModel treeModel = new JTree().getModel();

Code Sample 2.12 Creating a JTree Object