/ Forside / Teknologi / Udvikling / Java / Nyhedsindlæg
Login
Glemt dit kodeord?
Brugernavn

Kodeord


Reklame
Top 10 brugere
Java
#NavnPoint
molokyle 3688
Klaudi 855
strarup 740
Forvirret 660
gøgeungen 500
Teil 373
Stouenberg 360
vnc 360
pmbruun 341
10  mccracken 320
Jtree and Hashtable order
Fra : Nokomo


Dato : 31-12-02 21:47

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



 
 
Christopher Dean (03-01-2003)
Kommentar
Fra : Christopher Dean


Dato : 03-01-03 01:58

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.


Søg
Reklame
Statistik
Spørgsmål : 177558
Tips : 31968
Nyheder : 719565
Indlæg : 6408905
Brugere : 218888

Månedens bedste
Årets bedste
Sidste års bedste