Win a copy of Mastering Corda: Blockchain for Java Developers this week in the Cloud/Virtualization forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Bear Bibeault
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Jj Roberts
  • Carey Brown
Bartenders:
  • salvin francis
  • Frits Walraven
  • Piet Souris

JFrame locks freezes

 
Ranch Hand
Posts: 497
  • 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.
 
author
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: 497
  • 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?
 
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: 497
  • 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.
 
We find this kind of rampant individuality very disturbing. But not this tiny ad:
the value of filler advertising in 2020
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic