java.lang.Objectjavax.swing.AbstractSpinnerModel
javax.swing.SpinnerListModel
public class SpinnerListModel
A simple implementation of SpinnerModel whose
values are defined by an array or a List.
For example to create a model defined by
an array of the names of the days of the week:
List
so if an element of the underlying sequence changes, it's up
to the application to notify the ChangeListeners by calling
fireStateChanged.
This model inherits a ChangeListener.
The ChangeListeners are notified whenever the
model's value or list properties changes.
JSpinner,
SpinnerModel,
AbstractSpinnerModel,
SpinnerNumberModel,
SpinnerDateModel| Field Summary |
|---|
| Fields inherited from class javax.swing.AbstractSpinnerModel |
|---|
listenerList |
| Constructor Summary | |
|---|---|
SpinnerListModel()
Constructs an effectively empty SpinnerListModel. |
|
SpinnerListModel(List<?> values)
Constructs a SpinnerModel whose sequence of
values is defined by the specified List. |
|
SpinnerListModel(Object[] values)
Constructs a SpinnerModel whose sequence of values
is defined by the specified array. |
|
| Method Summary | |
|---|---|
List<?> |
getList()
Returns the List that defines the sequence for this model. |
Object |
getNextValue()
Returns the next legal value of the underlying sequence or null if value is already the last element. |
Object |
getPreviousValue()
Returns the previous element of the underlying sequence or null if value is already the first element. |
Object |
getValue()
Returns the current element of the sequence. |
void |
setList(List<?> list)
Changes the list that defines this sequence and resets the index of the models value to zero. |
void |
setValue(Object elt)
Changes the current element of the sequence and notifies ChangeListeners. |
| Methods inherited from class javax.swing.AbstractSpinnerModel |
|---|
addChangeListener, fireStateChanged, getChangeListeners, getListeners, removeChangeListener |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SpinnerListModel(List<?> values)
SpinnerModel whose sequence of
values is defined by the specified List.
The initial value (current element)
of the model will be values.get(0).
If values is null or has zero
size, an IllegalArugmentException is thrown.
values - the sequence this model represents
IllegalArugmentException - if values is
null or zero sizepublic SpinnerListModel(Object[] values)
SpinnerModel whose sequence of values
is defined by the specified array. The initial value of the model
will be values[0]. If values is
null or has zero length, an
IllegalArugmentException is thrown.
values - the sequence this model represents
IllegalArugmentException - if values is
null or zero lengthpublic SpinnerListModel()
SpinnerListModel.
The model's list will contain a single
"empty" string element.
| Method Detail |
|---|
public List<?> getList()
List that defines the sequence for this model.
list propertysetList(java.util.List>)public void setList(List<?> list)
value to zero. Note that list
is not copied, the model just stores a reference to it.
This method fires a ChangeEvent if list is
not equal to the current list.
list - the sequence that this model represents
IllegalArgumentException - if list is
null or zero lengthgetList()public Object getValue()
getValue in interface SpinnerModelvalue propertySpinnerModel.getValue(),
setValue(java.lang.Object)public void setValue(Object elt)
ChangeListeners. If the specified
value is not equal to an element of the underlying sequence
then an IllegalArgumentException is thrown.
In the following example the setValue call
would cause an exception to be thrown:
model.setValue("TWO");
setValue in interface SpinnerModelelt - the sequence element that will be model's current value
IllegalArgumentException - if the specified value isn't allowedSpinnerModel.setValue(java.lang.Object),
getValue()public Object getNextValue()
null if value is already the last element.
getNextValue in interface SpinnerModelnull if value is already the last elementSpinnerModel.getNextValue(),
getPreviousValue()public Object getPreviousValue()
null if value is already the first element.
getPreviousValue in interface SpinnerModelnull if value is already the first elementSpinnerModel.getPreviousValue(),
getNextValue()Ces informations proviennent du site de http://java.sun.com
Le contenu de cette page provient du site de Sun, et est généré depuis un cache sur l'infobrol après certains traitements automatisés. La présentation peut donc différer du document original, mais le contenu aussi. Vous pouvez utiliser ce bouton pour afficher la page originale du site de Sun :
Maintenir les pages en cache sur différents sites peut offrir plus de disponibilité.
Chaque page est indexée dans la base de donnée, ce qui permet de retrouver facilement les informations, au moyen des sommaires, du moteur de recherche interne, etc.
Des facilités sont mises en place pour que les membres de l'infobrol puissent effectuer des traductions en français des différents documents. Ceci devrait permettre aux débutants en programmation Java de consulter les API en français s'ils maîtrisent moins bien la langue de Shakespeare. Dans le cas où une traduction a été soumise, elle est disponible au moyen d'un lien en bas de page. Si la traduction a été validée, la page s'affiche par défaut en français, et un lien en bas de page permet d'atteindre la version en anglais.
Le code sur l'infobrol est automatiquement coloré selon la syntaxe, et les différents mots clés sont transformés en liens pour accéder rapidement aux informations.
Vous avez la possibilité de partager vos expériences en proposant vos propres extraits de code en utilisant le bouton "ajouter un commentaire" en bas de page. Si vous visitez simplement l'infobrol, vous avez déjà accès à cette fonction, mais si vous étes membre du brol, vous pouvez en plus utiliser des boutons supplémentaires de mise en forme, dont la coloration automatique de vos extraits de codes.
Vous pouvez modifier vos préférences dans votre profil pour ne plus afficher les interactions avec les réseaux sociaux sur ces pages.
6 mots clés dont 0 définis manuellement (plus d'information...).
Avertissement
Cette page ne possède pas encore de mots clés manuels, ceci est donc un exemple automatique (les niveaux de pertinence sont fictifs, mais les liens sont valables). Pour tester le nuage avec une page qui contient des mots définis manuellement, vous pouvez cliquer ici.Vous pouvez modifier vos préférences dans votre profil pour ne plus afficher le nuage de mots clés.
Recherche (afficher)
Utilisateur (masquer)
Navigation (masquer)
Apparence (afficher)
Stats (afficher)
Citation (masquer)