Does anyone know how to find out if a user has been inactive (no mouse activity or keyboard activity) in a Swing application for a certain period of time?
posted 14 years ago
you need a separate thread that couts the time from one user activity on to the next. with every button or mouse click or key input or whatever, the timer has to be restarted. hm, sounds like a lot of work. another possibility is to listen for the inactivity of the main frame. then you would only have to count the time when the applicaiton frame(s) has(have) lost focus. cheers, Chantal