SpinnerListModel for an ordered list of objects. - Java Swing

Java examples for Swing:JSpinner

Description

SpinnerListModel for an ordered list of objects.

Demo Code

import javax.swing.JSpinner;
import javax.swing.SpinnerListModel;

public class Main {

  public static void main(String[] args) {
    String[] seasons = new String[] { "Spring", "Summer", "Fall", "Winter" };
    SpinnerListModel sModel = new SpinnerListModel(seasons);
    JSpinner listSpinner = new JSpinner(sModel);

  }/*from   w ww. ja  v  a 2 s .  com*/
}

Related Tutorials