Java Swing JList -


I am trying to create a JList to display the content of an array. The array itself is not an array of wires, however, but an array of objects.

Is it possible to use the same array of objects as a parameter in my Zelist (if the objects are given a toString method)?

Thank you.

Yes it is.

A list uses an object called a cell renderer so that it can display each of its items. The default cell renderer knows how to display the strings and icons and it displays the object by applying toString .

See:


Comments

Popular posts from this blog

c# - How to capture HTTP packet with SharpPcap -

php - Multiple Select with Explode: only returns the word "Array" -

php - jQuery AJAX Post not working -