Solved

Storing object into JList

Posted on 2003-11-27
7
274 Views
Last Modified: 2010-03-31
Is there any way that I can store object to JList?
0
Comment
Question by:dkim18
  • 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
Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

 
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

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
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.

706 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now