• 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:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

Problem reactivating JDialogs

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, I have built an Application with a JFrame at the core and several modal JDialogs that launch from it.
Problem: In windows if I switch applications (e.g. launching a browser) while one of the dialogs is open when I click the application icon on the status bar to get back to the application I get the home JFrame, not the dialog.
Since the dialog is still open somewhere and modal the JFrame is locked down. A problem.
I can get back to the dialog by using alt+tab to toggle through the active applications.
Any insights would be appreciated.
Caleb Tower
 
Ranch Hand
Posts: 15304
6
Mac OS X IntelliJ IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It's because you didn't tell the JDialog what it should be model to.
JDialog(Frame owner, String title, boolean modal)

Frame owner tells the JDialog what it is suposed to stay on top of all the time, so you should specify your JFrame.
[ September 09, 2002: Message edited by: Gregg Bolinger ]
 
Caleb Tower
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for the feedback.
I actually have been very good about parenting my dialogs. Primarily so I can center them over the parent frame.
So, the owner thing is not the problem, most likely.
Rather it is a window listener issue of some sort. In one case, when the system focus returns to the APP, I get the currently open dialog, and
in the other case I get the home frame, which is locked by the (not showing) dialog's modality...
Sounds like I'll be delving into window listeners for a while... any suggestions would be appreciated.
Caleb T
reply
    Bookmark Topic Watch Topic
  • New Topic