user2815224
user2815224

Reputation: 11

Pop up a JFrame in front of a modal JDialog

In the application we are designing, we have a class that inherits from JFrame. This class launches a derived class of JDialog that is modal in order to capture some input from the end user. This derived class now needs to launch a different JFrame due to a new requirement.

The problem we are facing is that if we set the JDialog to be a non modal dialog, then the data from the JDialog does not get saved when we hide the dialog using setVisible(false).

On the other hand if we keep it modal, the new form doesn't get launched and is always hidden.

Any ideas why modality affects the dialog object?

I was FINALLY able to fix this by setting the Application Exclusion modality type in the new Frame i'm popping up! Thanks everyone for all the help!!

Upvotes: 1

Views: 665

Answers (1)

Vampire
Vampire

Reputation: 38619

I'd say the modality is not, or only part of, the problem. The questions is how you save your data. This does not automagically happen when you hide the dialog, does it? You most likely listen to some event or button action to extract and save the data from the dialog. So you should review your mechanism that extracts and saves the data and see on what it relies that is not triggered when modality is off.

Upvotes: 0

Related Questions