![]() |
Overview |
This document is intended to be used by application builders who would like to build Java applications which provide date increment/decrement functionality. The application developer is expected to be familiar with the Java language and the JavaBeans architecture. The developer should be familiar with building applications by linking beans in an application builder tool. Familiarity with the functionality of DateSpinner would be advantageous, though not mandatory. No knowledge about the implementation of DateSpinner is required in order to use these beans.
Conventions | Description | Example |
Text in italics | figures, reference to chapters and other sections, task name etc. | Figure 1, Overview, etc. |
|
list of points |
|
Text in Courier font |
names of classes,methods, events, part of code included in the document, etc. |
ActionPerformed |
Image | Used to |
![]() |
navigate to the previous sub-heading |
![]() |
navigate to the previous main heading |
![]() |
return to the Table of Contents |
![]() |
represent a Note information |
Overview - introduces the user to the DateSpinner bean. Provides information like intended audience, guide conventions, guide organization and copyrights
Bean at a Glance - gives a brief overview of the bean. It also provides information on the commonly used methods, events and properties.
Bean Description - explains the bean in detail. It provides information on dependencies, security, customization, etc.
Summaries - summarizes the properties, methods and events of the bean.
Reference to Properties - links to the respective properties.
Reference to Methods - links to the respective methods.
Reference to Events - links to the respective events.
Support Classes - provides information on the public classes.
See Also- links to related topics
Copyright © 1998 IBM Corp.
All rights reserved.
IBM and VisualAge are trademarks of International Business Machines in the United States and/or other countries.
* Java and all Java-based trademarks and logos are trademarks or registered trademarks of Sun Microsystems, Inc, in the U.S. and other countries.
![]() |
Bean at a Glance |
public class DateSpinner extends Spinner
This bean is a component with two small direction buttons
that lets the user modify the value in an input field or possibly enter
a new legal date value directly in the input field. By setting the value
of the specified property, the user can separately increase the year, month
and day. It allows different date formats(i.e. mm/dd/yyyy or dd/mm/yyyy).
DateSpinner()
DateSpinner(int
mask_index)
currentValue
minValue
maxValue
stepValue
stepUnit
elapsedDays
dateMaskIndex
getCurrent()
Gets the current date value
of the DateSpinner.
setCurrent(Date cur_val)
Sets the current date value
of the DateSpinner.
Increment - The
event is fired to all registered ActionListeners when the currrent value
of DateSpinner increases.
Decrement - The event
is fired to all registered ActionListeners when the currrent value of DateSpinner
decreases.
![]() |
Bean Description |
The DateSpinner allows
The DateSpinner requires the services of
Only Java security restrictions apply.
The bean has a user-friendly GUI. Refer to the section User Interface in the Spinner Overall bean documentation for detailed information.
public class DateSpinnerBeanInfo
![]() |
Summaries |
<Name> | [Constrained | Bound | Indexed ] | <Datatype> | <Description> | <default value> | <access type> |
dateMaskIndex | Bound | int | Date format option | 0 | Read / Write |
stepUnit | Bound | int | Step unit (year,month or day) | 0 | Read / Write |
stepValue | Bound | int | Increment value | 1 | Read / Write |
minValue | Bound | Date | Minimum value | 1998-01-01 | Read / Write |
maxValue | Bound | Date | Maximum value | 1998-12-31 | Read / Write |
currentValue | Bound | Date | Current value | 1998-01-01 | Read / Write |
elapsedDays | Bound | int | Days between Minimum and Maximum value | 364 | Read / Write |
dayDisplayEnabled | Bound | boolean | Day displaying option | true | Read / Write |
As Listener :
![]() |
Reference to Properties |
![]() |
Reference to Methods |
public void addActionListener(ActionListener
l)
Adds the specified action listener to receive action
events.
Parameters:
l - the ActionListener to be added.
Constructor for DateSpinner. Constructs a DateSpinner
with default settings. The GUI is constructed and initialized with pre-set
values.
Constructor for DateSpinner. Constructs a DateSpinner with specified date format.
Parameters:
mask_index - the date format index.
Gets the current date value.
Returns:
the current date value.
Gets the date format.
Returns:
the date format.
Gets the elapsed days between the minimum and the maximum value.
Returns:
the elapsed days between the minimum and the maximum value.
Gets the maximum value.
Returns:
the maximum value.
Gets the minimum value.
Returns:
the minimum value.
Gets the increment value.
Returns:
the increment value.
Gets the increment unit(i.e. year,month and day).
Returns:
the increment unit.
Returns a boolean to indicate wether the day display option is selected.
Returns:
the day display option.
Removes the specified action listener so that it will no longer receive action events.
Parameters:
l - the ActionListener to be removed.
Sets the current date value.
Parameters:
cur_val - the desired date value.
Sets the date format.
Parameters:
mask_index - the desired date format.
Sets the day display option.
Parameters:
disp_flag - boolean to indicate the day display option.
Sets the elapsed days between the minimum and the maximum value (Note that when the elapsed days changes to a different value, the maximum value will be changed accordingly).
Parameters:
val - the desired elapsed days between the minimum and the maximum value.
Sets the maximum value.
Parameters:
max_val - the desired maximum value.
Sets the minimum value.
Parameters:
min_val - the desired minimum value.
Sets the increment value.
Parameters:
step_val - the desired increment value.
Sets the increment unit(i.e. year, month and day).
Parameters:
unit -the desired increment unit.
![]() |
Reference to Events |
The DateSpinner fires the following events:
public class java.awt.event
ActionEvent
Specifies the DateSpinner current increment/decrement
value.
public interface
java.awt.event.ActionListener
Event listener interface for ActionEvent. The methods
contained in the interface are:
Indicates the current increment/decrement value.
Parameters:
e - ActionEvent.
![]() |
Support Classes |
None.
![]() |
See Also |
This document is last updated in V1.0 on 04/02/1998