🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Ordering of Nodes in JTree

#9383
From: Tamy Staub
Date: Mon, 03 Apr 2000 00:00
10 lines
1169 bytes
I am working on an App that uses a JTree, with a DefaultTreeModel, with
customized nodes derived from DefaultMutableTreeNode. As nodes are added
they are displayed in the JTree in alphabetical ordering by node labels
under their parent nodes. This is a problem because 1)strings including
numerics do not alphabetize as expected (i.e. "node12" will show up directly
after "node1" and before "node2") and also in certain situations, I want to
order by a different requirement, like a sequence number. Is there any
simple way to control the order in which the nodes are displayed in the
tree? Can 2 different criteria for ordering be used in the same tree? Any
suggestions on how to accomplish this? Thanks! T.
Technical Details
Message-ID: <8cakem$aeb12@bornews.borland.com>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 111d45,2e30d3022aeaffe,start
X-Google-Attributes: gid111d45,public
From: "Tamy Staub" <tamy.staub@trw.com>
Subject: Ordering of Nodes in JTree
Date: 2000/04/03
Message-ID: <8cakem$aeb12@bornews.borland.com>
X-Deja-AN: 606154154
Organization: Another Netscape Collabra Server User
X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3
Newsgroups: borland.public.jbuilder.java.swing