Java Utililty Methods JList Item

List of utility methods to do JList Item

Description

The list of methods to do JList Item are organized into topic(s).

Method

ObjectgetItemList(JList anJList, int index)
getSelecetdList
return anJList.getModel().getElementAt(index);
ListgetItems(JList list)
_more_
List items = new ArrayList();
ListModel model = list.getModel();
for (int i = 0; i < model.getSize(); i++) {
    items.add(model.getElementAt(i));
return items;
String[]getJListItemAry(javax.swing.JList jlist)
get J List Item Ary
int size = jlist.getModel().getSize();
String[] ary = new String[size];
for (int i = 0; i < size; i++) {
    ary[i] = (String) jlist.getModel().getElementAt(i);
return ary;
Object[]getListItems(JList list)
get List Items
ListModel lm = list.getModel();
synchronized (lm) {
    Object[] ret = new Object[lm.getSize()];
    for (int i = 0; i < ret.length; i++) {
        ret[i] = lm.getElementAt(i);
    return ret;