this is the first list:
String[] data = {"Access97", "Basic Programming",
"C++ Programming", "COBOL Programming",
"DB Design", "Fortran programming"};
IndustrySkillsList = new JList(data);
i add the selected skill to another list:
DefaultListModel listModel = new DefaultListModel();
JList ApplicantSkillsList = new JList(listModel);
using the add button:
public class Add2Listener implements ActionListener
{
public void actionPerformed(ActionEvent e)
{
String temp1;
temp1 = (String)IndustrySkillsList.getSelectedValue();
listModel.addElement(temp1);
}
}
is it possible to store the 2nd list, after the stuff has been added from the first list, in a vector? so that in future i can retrieve this 2nd list and display it? if so, could anybody explain or tell me how to?
well you could just add the whole list to the Vector, i.e. add the whole Jlist to the Vector. then just pull it off later and add it back into the frame.
but the best way would be to use (String)Jlsit.getModel.getElementAt(index), to cycle through all the elements and get them off, you can then just add them into a Vecror.
look at the Jlist and Vector APIs its pretty simple.