• Post Reply Bookmark Topic Watch Topic
  • New Topic

Timeout User After Inactivity in Swing App

 
Josh Johnson
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
Chantal Ackermann
Ranch Hand
Posts: 508
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!