Hi all,
Suppose you have an application, showing multiple windows. If a modal dialog
is created with one of the windows as a parent, all top-level containers are
locked (which is good), but only the parent of the container will bring up
the dialog when clicked or selected in, say, the windows taskbar. Therefore,
if your users have never heard of alt+tab, they can have a hard time looking
for the dialog, when having switched to another application for example.
Even more so if a dialog is created without a parent, and thus the other
(locked) windows can cover the dialog, making it unreachable to
alt-tab-ignorant users, and yielding lots of "thy program is blocking
again" - "no it isn't" - discussions. Or, more accurately, monologues.
Is there any way to have modal dialogs always be in front? Or to have them
pop to the front when any window is selected, instead of just the parent?
Preferably without having to write my own JDialog / JOptionPane variant...
Thanks and greetings,
--
Bart
SPG - 05 Feb 2004 15:56 GMT
Hi,
The way I do it is to have a static instance of the main frame of your
application.
I then expose that using a static get method.
All dialogs that are shown use that reference as the parent window.
It works really well.
Steve
> Hi all,
>
[quoted text clipped - 16 lines]
> --
> Bart
Snowbart - 06 Feb 2004 07:39 GMT
> Hi,
>
[quoted text clipped - 3 lines]
> All dialogs that are shown use that reference as the parent window.
> It works really well.
Hi Steve,
Thanks for the reply.
I already do it that way, but the 'main' frame is seldom the focused frame,
and very small too, so when the user calls a dialog from a non-main window,
switches to another application and back to the window he was using, the
dialog will still be hidden, and the window will still be blocked.
I was actually hoping for some way to exclude some events from being
blocked, so that for example clicking on any window can call the main
window+dialog to front.
Using internal frames is also not an option, because I need some heavyweight
components, and heavyweight + internal frames = nono.
Thanks anyway,
- Bart
ak - 06 Feb 2004 12:37 GMT
> I was actually hoping for some way to exclude some events from being
> blocked, so that for example clicking on any window can call the main
> window+dialog to front.
see here http://www.javaworld.com/javaworld/javatips/jw-javatip89.html
--
____________
http://reader.imagero.com the best java image reader.
Snowbart - 06 Feb 2004 15:31 GMT
> > I was actually hoping for some way to exclude some events from being
> > blocked, so that for example clicking on any window can call the main
> > window+dialog to front.
>
> see here http://www.javaworld.com/javaworld/javatips/jw-javatip89.html
Thanks a lot!
--
Bart