1

I want to display an array list in a JList. I have a method that accepts this string...not sure how to approach this

1 Answer 1

1

JList provides a constructor JList(Object[]) which you can call after unpacking your ArrayList<String> using toArray()

list = new JList(arr.toArray())
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.