• 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
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

JDialog in front when JFrame on top?

 
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,
In my (one and only) JFrame it is possible to call up several JDialogs, only one or two at a time. These jdialogs are setModal(true). Now, everything works fine, but when I start another program, i.e. Windows Explorer, and I want to move back to my little application via the windows-taskbar, it's only possible to view the jframe, but not an (open) jdialog. I can only switch to the open dialog via Alt + Tabulator.
How can I automatically switch to an open JDialog whenever the JFrame is in front of the screen?
I've heard that maybe I should replace the dialogs by frames but I don't want to fill the windows-taskbar with more than one 'button' for the same application...
Any ideas?
Thanks in advance!
Tom
 
Bartender
Posts: 2205
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Are you passing the parent component (your JFrame) to the JDialog constructor? If so, then the dialog will always be on top of the JFrame. If you don't, then you'll have a modal dialog that's drawn behind your JFrame when you click back on the application.
I don't know of any way in java to add a JDialog to the task bar.
 
Tom Rodrigo
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hey Rob,
you did it!
It took me some work to pass the JFrame to the JDialog constructor, but it works fine now...
Thanks for you help!
Tom
 
We're being followed by intergalactic spies! Quick! Take this tiny ad!
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic