Solved

Storing object into JList

Posted on 2003-11-27
7
281 Views
Last Modified: 2010-03-31
Is there any way that I can store object to JList?
0
Comment
Question by:dkim18
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
7 Comments
 
LVL 92

Expert Comment

by:objects
ID: 9834390
add it to the lists model.
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 9834392
Yes. just add it to the JList's model
0
 
LVL 92

Assisted Solution

by:objects
objects earned 25 total points
ID: 9834401

DefaultListModel model = new DefaultListModel();
JList list = new JList(model);
model.addElement(object);
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 86

Accepted Solution

by:
CEHJ earned 100 total points
ID: 9834402
Vector model = new Vector();
model.add(yourObject);
JList l = new JList(model);
0
 
LVL 92

Expert Comment

by:objects
ID: 9834464
0
 
LVL 92

Expert Comment

by:objects
ID: 9893345
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 9893391
8-)
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.
Suggested Courses

751 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question