|
Demo Readme
|
DatesBeans Suite Version 1.0
This demo shows, how you can create applications for
operation with dates in various formats.
To see the wiring and
run the application in VisualAge for Java 2.0, import the Bean Suite jar
files (in the lib directory) and the demo dat file (in the demo
directory) into VisualAge for Java 2.0. The dat file contains a demo package
that you can add to any project in your VisualAge workspace. Use VisualAge's "Check
Class Path..." option to compute the correct CLASSPATH setting before you run the
demo application. This will ensure that VisualAge can locate all the classes needed to run
the application.
How to Run This Demo
- First, make sure the DatesBeans Bean Suite is properly
installed, as described in the documentation provided
with this package.
- Change to the demo directory and type java runDemo at the
command prompt. This starts the demo.
What the Demo Does
The given application shows how to account the
amount of days having passed since the moment of your birth till the current date. At
start on the screen there is a window (see below) in which the user sets the main
characteristics:

Figure 1. DatesBeans Bean Suite Demo
Where:
Enter your birthday: TextField - the date of your
birthday.
Today: TextField - the current date.
Your age in days: TextField - amount of past days from the moment of your birth
before the current date.
Compute: Button - The button for account.
Wiring Instructions
To build an application, you should execute the following
steps:
- Create a new class with the Frame superclass.
- Put on the frame:
- TextField for your birthday (set the "Enter
your birthday" label);
- TextField for the current date (set the "Today"
label);
- TextField for your age in days (set the "Your
age in days" label);
- Button for start of account;
- Put on the design surface:
- DateConverter for processing your birthdate;
- DateSupport for processing the current date;
- DateEvaluator for calculation of an amount of past days past
from the moment of your birth before the current date;
Do the following connections:
- Wire the "Today" TextField.this
property to the DateSupport1.inputComponent property;
- Wire the DateSupport1.result property to the
DateEvaluator1.inputFirstArg property;
- Wire the "Enter your birthday"
TextFiled.text property to the DateConverter1.inputText property and set "Source
event" as "textValueChanged" in the property
panel of this connection;
- Wire the DateConverter1.resultDate property to the
DateEvaluator1.inputSecondArg property;
- Wire the "Calculate"
Button.actionPerfomed event to the DateEvaluator1.triggerAction() method;
- Wire the DateEvaluator1.resultAsDays property to the "Your
age in days" TextField.text property;

Figure 2 - The wiring diagram