i am trying to add ArrayList to Jlist, but the only way that I given to understand is that to write the code like this :
ArrayList labels = new Arr
It's simple. JList constructors don't expect ArrayList
JList()
Constructs a JList with an empty, read-only, model.
JList(E[] listData)
Constructs a JList that displays the elements in the specified array.
JList(ListModel dataModel)
Constructs a JList that displays elements from the specified, non-null, model.
JList(Vector extends E> listData)
Constructs a JList that displays the elements in the specified Vector.