java - How to access a particular element in JLIST? -
i trying push selected value @ index 'a' index 'a+1'.
but if index 'a+1' not empty, have swap 2 values. this, not know how obtain value @ index 'a+1'. not selected. jlist api not support random access.
how implement ?
thanks.
to access elements in jlist need hold of listmodel.
the model has getelementat(int) method.
item = myjlist.getmodel().getelementat(a+1);
Comments
Post a Comment