I want to create in Java Swing a JDialog which, when it's open, its parent window cannot be accessed (just like when you open the file explorer dialog in Microsoft Word). Is there any method in the JDialog class that provides this behaviour?
use JDialog.setModal(true) before setting dialog visible
JDialog yourdialog = ...
yourdialog.setModal(true);
...
yourdialog.setVisible(true);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With