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

Problem reactivating JDialogs  RSS feed

 
Caleb Tower
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • 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
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • 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
  • 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
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!