I have such situation: I need to stop executing of code while i show custom JFrame. So, I have main frame where I call another frame:
CreateDialog _create = new CreateDialog("Project");
_create.CreateProject();
JOptionPane.showMessageDialog(_create, "Yes");
where CreateProject extends JFrame and has some info, textareas and control buttons. So i wanna see MessageDialog when i close CreateDialog frame, but it shows me CreateDialog frame MessageDialog over it. How can I hold code execution while CreateDialog is running?