I've a simple JDialog with JOptionPane and it works fine. But I want to use JFrame and create more complex window but I want it to act as JDialog, it means I need to halt code when JFrame or JDialog opens as next steps depends on what is chosen in window.
Here is my Class, is there anyway to run it so that it halts my code
public class MyFrame extends JDialog{
private static final long serialVersionUID = 1L;
public MyFrame() throws IOException {
setSize(600, 450);
dialogInit();
setTitle("Travel");
setVisible(true);
URL url = this.getClass().getResource("/images/travel1.png");
BufferedImage bf = ImageIO.read(url);
this.setContentPane(new backImage(bf));
JButton b = new JButton("Send");
JCheckBox tf=new JCheckBox("Country");
b.setBounds(318, 143, 98, 27);
tf.setBounds(235, 104, 150, 27);
add(b);
add(tf);
}
}