|
Re: user idle time
|
Posted: Dec 6, 2002 1:55 AM
|
|
hai,
take a instance variable long (ex: long t1), in Applet init initialize to System.currentMillis(); wait for a event to occur in ur Applet or Application. event may be focus, key, mouse etc.., in event handler get the System.currentMillis(); (ex: t2) and substract this with instance long variable which u initilized in init. then u will get the idle time of first event. i.e., idle time = t2-t1. then assign t1 to t2=> t1 = t2. then wait for next event to occur.
ok..have u got it..
|
|