ClockBean - A Java Bean written by me.Java 1.1 Enabled browser needed to view. |
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:
Download the ClockBean. CLOCK.ZIP
Using ClockBean in BDK
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