mariusz2108
mariusz2108

Reputation: 881

JDialog and disable main window

I use JDialog in my project. When I click button in main frame JDialog frame appears and main window becomes inactive. Is there any possibility to remain main window active?

Upvotes: 1

Views: 1820

Answers (1)

Hovercraft Full Of Eels
Hovercraft Full Of Eels

Reputation: 285430

When I click button in main frame JDialog frame appears and main window becomes inactive. Is there any possibility to remain main window active?

The solution: Make the JDialog non-modal either directly,

myDialog.setModalityType(ModalityType.MODELESS);

or by passing the correct ModalityType into your JDialog's constructor.

JDialog myDialog = new JDialog(myFrame, "My Dialog", ModalityType.MODELESS);

Upvotes: 2

Related Questions