🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.java
Article #590

Re: Jtree and Hashtable order

#590
From: Christopher Dean
Date: Fri, 03 Jan 2003 00:58
18 lines
2057 bytes
Nokomo wrote:

> Hi
>
> i insert some element into a hashtable and then i give hashtable to a 
> JTree
> to show those elements as tree.
> My problem:
> I want JTree to show my element in the order that i insert them into
> hashtable how to do that?
> I will be happy if anyone can give me some direction, ida,...
> Thanks
> Nokomo
>
>
If you are using JDK 1.4  use a LinkedHashMap instead of hashtable and 
when you iterate through the keySet to create the Tree you will get them 
in order.
Technical Details
Message-ID: <Pe5R9.758$Sa3.59492@twister.tampabay.rr.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed1.cidera.com!Cidera!cyclone.tampabay.rr.com!news-post.tampabay.rr.com!twister.tampabay.rr.com.POSTED!53ab2750!not-for-mail
References: <3e120231$0$198$edfadb0f@dread15.news.tele.dk>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f9a23,691113b2e5c7c62b
X-Google-Attributes: gidf9a23,public
X-Google-Thread: f5d71,691113b2e5c7c62b
X-Google-Attributes: gidf5d71,public
X-Google-Thread: 10a146,691113b2e5c7c62b
X-Google-Attributes: gid10a146,public
X-Google-Thread: 113ae9,691113b2e5c7c62b
X-Google-Attributes: gid113ae9,public
X-Google-ArrivalTime: 2003-01-02 16:58:24 PST
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed1.cidera.com!Cidera!cyclone.tampabay.rr.com!news-post.tampabay.rr.com!twister.tampabay.rr.com.POSTED!53ab2750!not-for-mail
From: Christopher Dean <loosecannon_1@yahoo.com>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.2b) Gecko/20021016
X-Accept-Language: en-us, en
MIME-Version: 1.0
Newsgroups: comp.lang.java,comp.lang.java.help,comp.lang.java.programmer,dk.edb.programmering.java
Subject: Re: Jtree and Hashtable order
References: <3e120231$0$198$edfadb0f@dread15.news.tele.dk>
In-Reply-To: <3e120231$0$198$edfadb0f@dread15.news.tele.dk>
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
Lines: 19
Message-ID: <Pe5R9.758$Sa3.59492@twister.tampabay.rr.com>
Date: Fri, 03 Jan 2003 00:58:23 GMT
NNTP-Posting-Host: 65.33.168.49
X-Complaints-To: abuse@rr.com
X-Trace: twister.tampabay.rr.com 1041555503 65.33.168.49 (Thu, 02 Jan 2003 19:58:23 EST)
NNTP-Posting-Date: Thu, 02 Jan 2003 19:58:23 EST
Organization: RoadRunner - Central Florida