SpinnerListModel Class

Package: javax.swing

Using this provides an implementation of the SpinnerModel interface from which you create JSpinner controls that let the user select from a list of items.

CrossRef.eps For more information, see JSpinner Class.

Constructors

Constructor

Description

SpinnerListModel (Object[]values)

Creates a list spinner model using the values from the specified array.

SpinerListModel(List collection)

Creates a list spinner model using the values from the specified collection. The collection must implement the List interface.

To create a JSpinner control that uses the SpinnerListModel class, pass an array or a collection to the SpinnerListModel constructor. For example:

String[] ampmString = {“am”, “pm”};

ampm = new JSpinner(

new SpinnerListModel(ampmString));

In this example, the spinner lets the user select choices from an array of strings that contains two items.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset