Reputation: 881
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
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