File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java in General and the fly likes GUI timeout in Java client application Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "GUI timeout in Java client application" Watch "GUI timeout in Java client application" New topic
Author

GUI timeout in Java client application

Savithri Devaraj
Ranch Hand

Joined: Jun 26, 2000
Posts: 103
We like to implement a timeout in our Java client application (using JDK 1.1.8 and Swing 1.1.1) connecting to servlets on the SilverStream Application server.
The application consists of an input screen and depending on the request, an output screen. The user could expand/collapse the trees in the output screen or perform other requests on the input screen. If he is inactive for 20 minutes or more, we like to log him out and end the application after a message.
Does anyone know how we could implement this easily using the Swing GUI thread - keeping track for how long it has not performed any action in the user code??
If I have to write a new userInactiveTimer class, I will have to account for all actions on both the screens. I don't know if I am clear enough.
Any help/clue greatly appreciated,
Thanks,
Savithri
Savithri Devaraj
Ranch Hand

Joined: Jun 26, 2000
Posts: 103
Help Please!!
I could write a timer class and define a method to update the timer. In the ActionPerformed method of each and every button or component on either screen, I could update the timer. Is this the only way out? or, is there a simpler way to do this?
Any suggestions appreciated!!
Savithri
Anonymous
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
Savithri,
It looks like you are not getting any response in this forum. I will move the thread to Java In General (Intermediate).
Bodie
Bob Moranski
Ranch Hand

Joined: Nov 22, 2000
Posts: 177
I think you can make a timer and instantiate it in the global scope, reset it in each ActionListener, and System.exit(0) when 20 minute is reached.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: GUI timeout in Java client application
 
Similar Threads
GUI timeout in Java client application
How to extend a swing application
Swing GUI class architecture
method calls
Create Console tab like Eclipse