Click the Launch button to run SpinnerDemo using.The Another Date spinner displays one value in a range of Date objects (initially the current date) in a custom format that shows just a month and year. The Year spinner displays one value of a range of integers, initialized to the current year. The possible values for this spinner are specified using an array of strings. The Month spinner displays the name of the first month in the user's locale. The code for the main class can be found in Here is a picture of an application named SpinnerDemo that has three spinners used to specify dates: The spinner's possible and current values are managed by its model. The editor can be any JComponent, but by default it is implemented as a panel that contains a formatted text field. However, spinners should only be used when the possible values and their sequence are obvious.Ī spinner is a compound component with three subcomponents: two small buttons and an editor. Because spinners do not display possible values only the current value is visible they are often used instead of combo boxes or lists when the set of possible values is extremely large. Unlike combo boxes, spinners do not have a drop-down list that can cover up other components. Like editable combo boxes, spinners allow the user to type in a value. Lists in that they let the user choose from a range of values.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |