Analog JavaBean Clock

Download JavaBean Clock

Running the Bean

    This was the first JavaBean I ever wrote, modifying one of the first Java applets I ever wrote. This is not meant to be a tutorial on Beans or on the Bean Development Kit, but here are a few steps to running the BeanClock.

    You may download the Jar (Java ARchive) file containing the runnable code and use it as part of an application created with the BDK (Bean Development Kit) downloadable from JavaSoft, or within any other Bean development tool such as the latest Symantec Visual Cafe. I will assume you are using the BDK for now.

    Download the BeanClock.zip file, unzip it to produce a .JAR file and copy into your /bdk/jars directory along with the supplied examples.

    Start up the BeanBox (/bdk/beanbox/run), you should see an entry for BeanClock in the ToolBox on the lefthand side.

Customization
    Click on the BeanClock entry, then click within the BeanBox presentation space. The clock should start.

    A properties sheet should also appear, allowing you to change the "customizable properties", such as colours and whether the Date is shown.

Introspection

    BeanClock also makes visible a couple of methods to stop and resume the clock, just so I could test interaction with other Beans! Select a couple of buttons from the ToolBox.

    With a button selected, chose Edit/Events/ActionPerformed, move the mouse over the BeanClock and click again. You will see a list of "public" methods, including ResumeClock. Select ResumeClock and press OK. Then link the other button to SuspendClock.

    Clicking on these buttons should now interact with the BeanClock to start and stop.

Serialization

    Once you have customized the BeanClock and connected any actions you require, you may want to save the "application".

    Select File/Save from the BeanBox. This has resulted in each Bean serializing itself, ie. saving it's properties.

    You may then clear the BeanBox and reload the application you saved. You will see the BeanClock and buttons reload with your personalised options and actions.

Component Technology

    Although this is a very simple example of a Bean in action, it is immediately clear that JavaBeans technology opens up a new world of interoperable, platform-neutral, reusable components.

    We will be bringing you more "business oriented" JavaBeans as they are produced.