What would be best way of populating a JList?

Hi all,

I'm trying to put a list of users in a program so that one can be selected, I need to display the users name but also need to associate a user ID number with that field on that list that can't be seen.

The tutorials i've found only allow me to add the username and then when selected i can only retrieve index number that user is listed at. Would there be a way of storing the user ID as well in the list or should i use an array or something to store the IDs?

Thanks

[504 byte] By [Kaligulaa] at [2007-10-2 17:35:38]
# 1
http://forum.java.sun.com/thread.jspa?threadID=636201
Michael_Dunna at 2007-7-13 18:52:55 > top of Java-index,Java Essentials,New To Java...
# 2
Thanks, that should do the trick
Kaligulaa at 2007-7-13 18:52:55 > top of Java-index,Java Essentials,New To Java...