Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

technical design problem with 2 dependend dropdown fields

Status
Not open for further replies.

frag

Programmer
Dec 7, 2000
321
GB
Hi,

I have some problems to find a good solution for this problem:

There are some values in a JComboBox and depending on the value choosen in this box another JComboBox has to display values that belong to the selected value in the first box.

What do you think would be the best structure to store the values in (of course with the dependencies)... a vector, a linked list a custom object or something completely different?

Any help and a short example highly appreciate :)

cheers

frag

patrick.metz@epost.de
 
Would a hashtable be a good solution ?

patrick.metz@epost.de
 
To be fair, whatever *collection* you use - Vector, ArrayList, Enumeration, Hash* etc, compared to the processing time you use when utilising Swing will far outweigh the processing time semantics of a small collection object (unless you are processing thousands of entries).

Use whatever object you feel comfortable with - worrying about which implemetation will yield the most efficient memory/time saving will gain you only milliseconds of processing time, but will cost hours of testing headaches !
 
Yeah, I guess you are right... use Swing and it doesn't matter how fast your code is, Swing will slow down your application anyway.

I had some kind of blackout yesterday (don't know how to say it better in english). Just couldn't think of a way to implement it. ;)

patrick.metz@epost.de
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top