Here is the problem description; I am querying data from the database for one table which have 20 columns. I retrive the data and put the data into a vector. I only want to display first two columns (first name and last name) in the JList (populating JList with employee names). Each employee have a unique employee id which is not part of the JList display.

The question is how can I make it work that when I click on the name it should retrieve the right employee and populate my text field with rest of the information?