C graphics
C graphics

Reputation: 7458

JOptionPane.showConfirmDialog blocks the background windows

JOptionPane.showConfirmDialog popup (Y/N dialogues) blocks accessing other windows of the same application. (needless to mention I know it is the nature of this dialogue to bock other windows, however I dont want it for this app). In an application I open several jframes in each an image is loaded. Then at the end I ask user whether he/she wants the images to be saved or not. but the user has no access to go back and look at those windows as the JOptionPane.showConfirmDialog does not allow it. How can I set up JOptionPane.showConfirmDialog so that I still have access to the underneath windows?

Upvotes: 0

Views: 851

Answers (2)

camickr
camickr

Reputation: 324187

How can I set up JOptionPane.showConfirmDialog so that I still have access to the underneath windows?

Read the JOptionPane API. It shows you how to manually create and display the option pane. Since you have direct access to the dialog used and you can make it non-modal.

Upvotes: 1

martinez314
martinez314

Reputation: 12332

The JOptionPane dialogs are "modal" which means they intentionally block other windows, forcing the user to make a decision before continuing.

Try JDialog instead and setModal() to false.

Upvotes: 2

Related Questions