8.7.7.3.17 Time bean

 

 

The Time bean is used to display the time in hours, minutes and seconds.

 

The main events that are associated with the bean are value Changed event, action Event and focus event.

 

The main properties that are associated with the bean are as follows.
 

 

Property

Description

Time

This represents the time in milliseconds from Jan 1,1970

startTimer

This takes on values True/False depending on whether the timer is to be started or not

 

The main methods that are associated with this bean are setStartTimer, setHour, setMinute, setSecond and isRunning.

 

How to use the bean

 

It can be used along with SnmpPoller(in the AdventNetSnmp jar)  to perform a certain action at a given time.

 

The following code-snippet explains how to use the bean.

 

com.adventnet.beans.utilbeans.Time time1 = new com.adventnet.beans.utilbeans.Time();
time1.setHour(10);

time1.setMinute(40);

time1.setSecond(30);

time1.setStartTimer(true);

 

The first line does the instantiation. The second line sets the hour to be 10. The third line and the fourth line set the minute and second respectively. The last line starts the timer.



Copyright © 2011 ZOHO Corp. All Rights Reserved.