Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

JFrame locks freezes  RSS feed

 
Alejandro Barrero
Ranch Hand
Posts: 361
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a Java application that gets locked out when the user is inactive for certain time. When locked out, I display a JFrame with a button to unlock (this JFrame is set to stay always on top). When the screen saver is activated, and I reactivate the screen, in some PCs, the lock JFrame becomes blank and not reponsive (it is as if it is not receiving events. The only way to activate the JFrame is to minimize it and maximize it; the users are not happy with this solution.

Your help will be appreciated.
 
Ilja Preuss
author
Sheriff
Posts: 14112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It sounds like when the frame is shown again, it's repaint method isn't called. Can you verify that (by writing some debug message to the console or something)?
 
Alejandro Barrero
Ranch Hand
Posts: 361
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, it is not painted. I think that my problem is similar to the Swing Grey Fog discussed in (http://www.javalobby.org/java/forums/t15846.html). recently I had the same problem with a JInternalFrame. The worst thing is that the problem happens sporadically; I do not know what causes it. What could lock the AWT thread?
 
Benjamin Jung
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I assume that you try to do something with the JFrame using the wrong thread (JFC/Swing isn't thread-safe!).

If I get you right you bring the dialog to the front after unlocking of the screen?

Try this:

 
Alejandro Barrero
Ranch Hand
Posts: 361
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The JFrame that gets locked is not executing any code; it just displays a button for the user to log in again. It certainly looks like something in the AWT thread is locked, but it is strange that if I minimize the JFrame and maximize it it goes back to normal.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!