Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Storing object into JList

Posted on 2003-11-27
7
Medium Priority
?
283 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 100 total points
ID: 9834401

DefaultListModel model = new DefaultListModel();
JList list = new JList(model);
model.addElement(object);
0
The top UI technologies you need to be aware of

An important part of the job as a front-end developer is to stay up to date and in contact with new tools, trends and workflows. That’s why you cannot miss this upcoming webinar to explore the latest trends in UI technologies!

 
LVL 86

Accepted Solution

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

Expert Comment

by:objects
ID: 9893345
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 9893391
8-)
0

Featured Post

Build and deliver software with DevOps

A digital transformation requires faster time to market, shorter software development lifecycles, and the ability to adapt rapidly to changing customer demands. DevOps provides the solution.

Question has a verified solution.

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

After being asked a question last year, I went into one of my moods where I did some research and code just for the fun and learning of it all.  Subsequently, from this journey, I put together this article on "Range Searching Using Visual Basic.NET …
In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.
Suggested Courses

688 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