🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.language
Article #16881

Re: JTree node count

#16881
From: Leo Cohen
Date: Tue, 12 Jan 1999 00:00
29 lines
1101 bytes
Assuming that you're using DefaultTreeNodeModel, call its
getChildCount() method. You call it with the parent object and you get
back the number of children for that parent. e.g.;

	getChildCount(parent); 

Leo.

Jonathan wrote:
> 
> I want to be able to count the nodes in a JTree on a certain level, how do i
> do this?
> 
> how would i count the nodes generally ?
> 
> many thanks
> 
> Jonathan

-- 
Leo Cohen

116-1 Howard Drive
Charlottesville, VA  22903

804-243-8922 (UVA)
804-244-4648 (home)
804-244-7922 (fax)
lcohen@cs.virginia.edu
Technical Details
Message-ID: <369BAAE9.B37D1291@cs.virginia.edu>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <76vvit$d0m13@forums.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f74b3,b755c36e3273927c
X-Google-Attributes: gidf74b3,public
From: Leo Cohen <lcohen@cs.virginia.edu>
Subject: Re: JTree node count
Date: 1999/01/12
Message-ID: <369BAAE9.B37D1291@cs.virginia.edu>
X-Deja-AN: 431781053
Content-Transfer-Encoding: 7bit
References: <76vvit$d0m13@forums.borland.com>
Content-Type: text/plain; charset=us-ascii
Organization: Another Netscape Collabra Server User
Mime-Version: 1.0
Newsgroups: borland.public.jbuilder.java.language