ClockBean - A Java Bean written by me.

Java 1.1 Enabled browser needed to view.
 Download the ClockBean for free. See Below.
 

 For those who *don't* want all the technical stuff. On this page you see four clocks, each with a different style! But internally, It is the same Java Bean with different properties. This means, you can just pull out the clock and put it in your Java applet/application without you knowing how it works inside! It's that simple.

This is the first  Java Bean I developed using JDK 1.1.4. I have tested it on Sun's BDK (Bean Development kit) and Netscape Communictor with JDK 1.1 support. For the first Java Bean, the design and coding are surprisingly very easy. And the best part is this component can run on any machine/OS which supports Java!

Other Related Links:

Disclaimer:
You can download this free for use in your personal pages for non-commercial purposes. This source code and the .class and .jar files are given on an as-is basis and I assume no responsiblity of anything. You can change the source code and use it if you want, but however, make sure my name remains there :-)

Download the ClockBean. CLOCK.ZIP

Using ClockBean in BDK

 Source Code for using this in an Applet
/*********************************************************/
// File   : ClockBeanTest.java
// Author : Nagendra R Setty
//          nagendra@home.com
// Date   : 01/15/97
//    A simple applet which uses ClockBean and demonstartes
// the different properties of the Clock Bean!
/*********************************************************/
import java.awt.*;
import java.applet.*;
import ClockBean;

public class ClockBeanTest extends Applet {
   ClockBean bean1;
   ClockBean bean2;
   ClockBean bean3;
   ClockBean bean4;

   public ClockBeanTest () {
      setLayout (new GridLayout (2,2));
   }

   public void start () {
      // Optimisation. resume the
      // suspended threads of the clock bean.
      bean1.resume ();
      bean2.resume ();
      bean3.resume ();
      bean4.resume ();
   }
   public void stop () {
      // Optimisation. suspend the clock threads
      bean1.suspend ();
      bean2.suspend ();
      bean3.suspend ();
      bean4.suspend ();
   }
   public void init () {
      bean1 = new ClockBean ();
      bean2 = new ClockBean ();
      bean3 = new ClockBean ();
      bean4 = new ClockBean ();
      // using the various properties of the ClockBean.
      bean1.setDialString ("Dots");
      bean2.setDialString ("Numbers!");
      bean3.setDialString ("Three-D text");
      bean4.setDialString ("No seconds");

      bean1.setNumbersOn (false);
      bean3.setNumbersOn (false);
      bean4.setNumbersOn (false);

      bean1.setThreeDDialText (false);
      bean2.setThreeDDialText (false);
      bean4.setThreeDDialText (false);

      bean4.setSecondsOn (false);

      add (bean1);
      add (bean2);
      add (bean3);
      add (bean4);
   }
};
/*********************************************************/
// end of ClockBeanTest.java
/*********************************************************/

e-mail me your comments on my Java Bean
 Back to Nagendra's Home