Okay...I am trying to create a Start Screen...I want a dialog box to come up and it does, but then when the user clicks Yes, I would like a frame to open...this is my code so far...
CODE
import javax.swing.JOptionPane;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class StartScreen {
public static void main(String[] args) {
JOptionPane.showConfirmDialog(null, "Would you like to create a new room?", "New", JOptionPane.YES_NO_OPTION);
}
private static void createAndShowGUI() {
//Create and set up the window.
JFrame frame = new JFrame("FrameDemo");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
JLabel emptyLabel = new JLabel("Booooo");
emptyLabel.setPreferredSize(new Dimension(200, 100));
frame.getContentPane().add(emptyLabel, BorderLayout.CENTER);
//Display the window.
frame.pack();
frame.setVisible(true);
javax.swing.SwingUtilities.invokeLater(new Runnable() {
public void run() {
createAndShowGUI();
}
});
}
}
Thank you!