Im trying to through a JList by a for, the objective is to animate a Gif, in every item of the JList I have an Image, and when I push the Animate Button the for pass through every item on the JList and changes the Image on the Icon of the JLabel.
My problem is that I don't know how to use a for un a JList with the setSelectedIndex()
and the getSelectedIndex()
.
Thanks for the help.
I was trying with:
on = true;
while(on){
for(int i=0; i <=list.getSelectedIndex();i++){
list.setSelectedIndex(i);
}
}