BenCole
BenCole

Reputation: 2112

Java 5 - Bring Modal Dialog to Front on any click

Setting: Java 5 - no upgrade possible.

I have a large application that has a number of modal dialog windows. I have heard that hidden modal dialogs can result in uninformed users going so far as to restart their computer. Even if a user knows how to ALT-TAB (in MS Windows, at least), it's a pain. From what I understand, this was in part fixed in later versions of Java, but that's not an option here, unfortunately.

So, is there any way to force a modal dialog to be shown if any part of the running application is clicked on? I was thinking it might have something to do with either MouseListeners, GlassPanes, or something else. However, I've got a bunch of other stuff I'm supposed to be working on, so I don't have a lot of time to devote to hashing this out right now. Can anybody point me in the right direction?

Thanks so much!

Upvotes: 3

Views: 1440

Answers (1)

camickr
camickr

Reputation: 324207

So, is there any way to force a modal dialog to be shown if any part of the running application is clicked on?

When you create the dialog you need to specify the parent frame as the owner of the dialog. Then whenever you click on the frame any dialog that is a child will also be shown.

Upvotes: 3

Related Questions