Basically I want the JOptionPane "//main window" to take me back to the start but not to open a new instance of the program. see the red
Code:
//start
String name=JOptionPane.showInputDialog(null,"Enter your name");
JOptionPane.showMessageDialog(null,"Welcome " +name);
//move(main window)
String move=JOptionPane.showInputDialog(null, "1=Shop" +"\n2=Playground" +"\n3=Buy stock");
int go = Integer.parseInt(move);
//SHOP
if(go==1)
{
String sell1=JOptionPane.showInputDialog(null,"Sell Stuff" +"\n1=Move left" +"\n2=Move Right" +"\n3=Main Menu");
int sell=Integer.parseInt(sell1);
//sell right
if(sell==1)
{
JOptionPane.showMessageDialog(null,"1");
}
//sell left
else if (sell==2)
{
JOptionPane.showMessageDialog(null,"2");
}
[COLOR="Red"]//main window
else if (sell==3)
{
//go(main window)
move=JOptionPane.showInputDialog(null, "1=Shop" +"\n2=Playground" +"\n3=Buy stock");
go = Integer.parseInt(move);[/COLOR]