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

  1. First, make sure the DatesBeans Bean Suite is properly installed, as described in the documentation provided with this package.
  2. 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:

  1. Create a new class with the Frame superclass.
  2. Put on the frame:
    1. TextField for your birthday (set the "Enter your birthday" label);
    2. TextField for the current date (set the "Today" label);
    3. TextField for your age in days (set the "Your age in days" label);
    4. Button for start of account;
  3. Put on the design surface:
    1. DateConverter for processing your birthdate;
    2. DateSupport for processing the current date;
    3. DateEvaluator for calculation of an amount of past days past from the moment of your birth before the current date;

Do the following connections:

  1. Wire the "Today" TextField.this property to the DateSupport1.inputComponent property;
  2. Wire the DateSupport1.result property to the DateEvaluator1.inputFirstArg property;
  3. 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;
  4. Wire the DateConverter1.resultDate property to the DateEvaluator1.inputSecondArg property;
  5. Wire the "Calculate" Button.actionPerfomed event to the DateEvaluator1.triggerAction() method;
  6. Wire the DateEvaluator1.resultAsDays property to the "Your age in days" TextField.text property;

Figure 2 - The wiring diagram