Forums Register Login

String and Array

+Pie Number of slices to send: Send
I would like to be able to use the String containing the 26 letters of the alphabet in a JList. For now I have to put them in a String array. Is there any way of not having to declare a String array and using the String of letters in a JList?

+Pie Number of slices to send: Send
One possibility is to create a class that implements the ListModel interface. For convenience, you might want to extend AbstractListModel since it provides default implementations for some of the methods. If you need more information, check the Swing trail in the Java Tutorial (see the link in my sig).

I hope this helps.

Layne
+Pie Number of slices to send: Send
Thanks, this will give me an opportunity to learn more about a JList
this is supposed to be a surprise, but it smells like a tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 1018 times.
Similar Threads
Can a string array member serve as an index number of another string array?
not able to get the items from JList
need help on JList
Single interval selection in two lists
How to add a String array to JList?
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 10:55:21.