Assigning the content of an arrayList to JList

I want to assign the content of an arrayList to JList it cannot be done.
But if I use Array it was OK.

So, Can I assign an arrayList to JList with out converting the arrayList to array?

-----------------------

I tried this :


JList list = new JList(arrayList);
javamate06Asked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
CEHJConnect With a Mentor Commented:
You can do

JList list = new JList(new Vector(arrayList));
0
 
CEHJCommented:
:-)
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.