Article View: borland.public.jbuilder.java.swing
Article #9249Re: JTree
From: Paul Furbacher [TeamB]
Date: Wed, 03 May 2000 00:00
Date: Wed, 03 May 2000 00:00
23 lines
1318 bytes
1318 bytes
Redding Bacon wrote: > How can I display my file system in a JTree? Is there an object that > represents the file system that I could use like this: > > ... > DefaultMutableTreeModel top; > DefaultTreeModel treeModel ; > JTree jTree1; > > top = new DefaultMutableTreeNode( myFileSystemObject ); > treeModel = new DefaultTreeModel(top); > jTree1 = new JTree(treeModel); > ... I believe you'll have to write the algorithm which fills the tree model. I think that one of the early third-party JBuilder books had an example of how to write such an algorithm, but my memory is a bit foggy on this one. Also, if you search around enough, you may find a rudimentary example somewhere. Paul Furbacher (TeamB)
Technical Details
Message-ID:
<39106510.A9F6E1BD@home.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<8eernh$a7c3@bornews.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 111d45,7b98b7ab0d9ea22c X-Google-Attributes: gid111d45,public From: "Paul Furbacher [TeamB]" <pnf@home.com> Subject: Re: JTree Date: 2000/05/03 Message-ID: <39106510.A9F6E1BD@home.com> X-Deja-AN: 618777638 Content-Transfer-Encoding: 7bit References: <8eernh$a7c3@bornews.borland.com> X-Accept-Language: en,pdf Content-Type: text/plain; charset=us-ascii Organization: Another Netscape Collabra Server User Mime-Version: 1.0 Reply-To: pnf@home.com Newsgroups: borland.public.jbuilder.java.swing