Disable JFrame when opening a new JFrame

I try to disable "main" JFramewhen a new frame appears. I want you to not be able to click or drag anything on this frame. I tried to take a new frame JDialog, but this did not disable another frame. I also looked at another post about this that suggested making it JDialog, but it still doesn't work. I really need help with this. Thank you This is the code that I use to create JDialog, is it their problem with it?

editDialog=new JDialog(IntroScreen.frame);

IntroScreen.frame represents the "main" frame.

+5
source share
2 answers

JFrame, setEnabled() JFrame.

frame.setEnabled(false);

JDialog setModal().

+4

All Articles