Storing object into JList

Is there any way that I can store object to JList?
dkim18Asked:
Who is Participating?
 
CEHJCommented:
Vector model = new Vector();
model.add(yourObject);
JList l = new JList(model);
0
 
objectsCommented:
add it to the lists model.
0
 
CEHJCommented:
Yes. just add it to the JList's model
0
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
objectsCommented:

DefaultListModel model = new DefaultListModel();
JList list = new JList(model);
model.addElement(object);
0
 
objectsCommented:
0
 
CEHJCommented:
8-)
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.