• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Problem with a modal dialog

 
Ranch Hand
Posts: 502
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In an application we detect when the user has been inactive for some time, deactivate the application and open a JFrame with a button to open the login dialog. We use a JFrame because we want it to stay on top. The problem is that if the application opens a modal dialog, when the unlock frame comes up it is disabled. The worst happens sometimes when the dialog is not visible and everything looks frozen to the user.
Any help to solve this problem or to do things in a different way will be greatly appreaciated.
 
Marshal
Posts: 79178
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sorry people have taken so long to reply.

Don't know, but one thing which might help would be setting your Dialog window always on top. Look in the API for Dialog.
 
Alejandro Barrero
Ranch Hand
Posts: 502
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sorry, I forgot to say that the JFrame is always on top so that the user knows that she has to unlock the application. The problem is that the dialog is modal and it is the only part of the application that accepts events. That is what modal dialogs are supposed to do and perhaps the answer is that I have to use another idea for locking/unlocking the application the application. It appears that locking on user innactivity is a valuable idea; there ought to be a way.
 
Campbell Ritchie
Marshal
Posts: 79178
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Any chance of having an "unlock" button on your Frame, if the Frame is always on top?

Can't help much more; I am afraid I am rather clutching at straws here.

Sorry
 
Alejandro Barrero
Ranch Hand
Posts: 502
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Both frames (the application frame and the locking frame) are unable to get focus because of the modal dialog.
I changed the locking frame to a modal dialog and this one works even when the other modal dialog is open. The problem that I have now is that the login window (frame or dialog) that I open from the lock window cannot get the focus.
 
Campbell Ritchie
Marshal
Posts: 79178
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Don't know.

But it appears that having modal dialog which is not on top is counter-productive.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic