🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.swing
Article #7524

Re: Jtree

#7524
From: Khurram Shakir
Date: Tue, 16 Jan 2001 14:10
92 lines
3409 bytes
Yes TreeModel is an inteface, but javax.swing.tree.DefaultTreeModel is a
class that implements this interface. you can use this.
tree.setModel(new DefaultTreeModel(parent));
where parent is your root of tree.

there is a very good artical regarding JTree in java tutorial site, with
sample code as well. I am sending you the link,
http://java.sun.com/docs/books/tutorial/uiswing/components/tree.html

Hope after reading this you don't need any code sample from me, but If you
still want some code  then I will send it to you later.

Thanks,
--
Khurram Shakir
Sun Certify Programmer for Java 2 Platform

"Edgar Silva" <silva@atc.com.br> wrote in message
news:93vajn$qlv3@bornews.inprise.com...
>
> > Can you explain your problem in more detail,
> > I have an impression  that you want to create a model dynamically, if
so,
> > then after creating a TreeModel Object you must call
> > tree.setModel(TreeModel)  function, so that view can update its self
> > according to new Model.
> Re: Tahnks Khurram .... But Treemodel is not a Interface? When I declare a
> object and instancing with the TreeModel, I got errors when i using the
> statment:
>
>   TreeModel Clients = new TreeModel();
>
> Or scuse, but what the Packge, due a red the information I stand that
there
> is another classes that implement the interface this interface
TreeModel...
>
> Khurram..... can you expose a simple sample how to make this, with Jtree
> Swing...
>
> Simple Nodes...
>
> Clients...
>     - David Bowe
>           + CDS
>           -  DVDS
>                   ...None
>     - Beatles
>            - CDS
>                   ...YellowSubmarine
>                   ... Beatles For Sale
>            - DVDS
>                  ... YellowSubmarine
>
>
> Scuse again, I have experience with Delphi and Pynthon, I wanna to know
how
> is the funcionality inside this class....
>
>
> Thanks Again....
>
>
>
>
>
> > (Here tree is a instance of JTree class, that represents your view)
>
> > > Hi Folks...
>
> > > Somebody already work with JTree, i know that have a JTree to work
with
> > > datasets, but i want to permice a dinamic loading to JTree.
> > >
> > > I declared:
> > >   DefaultMutableTreeNode Root = new DefaultMutableTreeNode(jTree1);
> > >   DefaultTreeModel TView = new DefaultTreeModel(Root);
> > > --
> > >
> > > When I select the Model.... Dont happen nothing...
> > >
> > > Somebody, can help ?
> > >
> > > Thans to much...
> > >
> > > Edgar
> > >
> > >
> >
> >
>
>
Technical Details
Message-ID: <3a6454f9_2@dnews>
Path: arc1-ca.pugleaf.net!supernews.google.com!sn-xit-03!supernews.com!logbridge.uoregon.edu!newsfeed.wirehub.nl!PeerFeed.KWeb.on.ca!bornews.borland.com!dnews!203.135.24.27
References: <93nj7a$rj48@bornews.inprise.com> <3a602590_2@dnews> <93vajn$qlv3@bornews.inprise.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 111d45,1f7a045f6e4ff706
X-Google-Attributes: gid111d45,public
X-Google-ArrivalTime: 2001-01-16 06:08:08 PST
From: "Khurram Shakir" <kshakir@mail.com>
Newsgroups: borland.public.jbuilder.java.swing
References: <93nj7a$rj48@bornews.inprise.com> <3a602590_2@dnews> <93vajn$qlv3@bornews.inprise.com>
Subject: Re: Jtree
Date: Tue, 16 Jan 2001 19:10:36 +0500
Lines: 94
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.00.2919.6700
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6700
NNTP-Posting-Host: 203.135.24.27
Message-ID: <3a6454f9_2@dnews>
X-Trace: 16 Jan 2001 06:04:41 -0800, 203.135.24.27
Path: arc1-ca.pugleaf.net!supernews.google.com!sn-xit-03!supernews.com!logbridge.uoregon.edu!newsfeed.wirehub.nl!PeerFeed.KWeb.on.ca!bornews.borland.com!dnews!203.135.24.27