Awnsers below worked, thanks guys!
boolean Again = true;
while (Again = true)
{
String input = JOptionPane.showInputDialog(null, "Input Za Number");
try
{
int input2 = Integer.parseInt(input);
int R1 = 1;
int R2 = 1;
while (R2 < input2)
{
R1 = R1 * 2;
R2 = R2 + 1;
JOptionPane.showMessageDialog(null, R1);
}
String Ag = JOptionPane.showInputDialog(null, "Do it again? (Y/N)");
if (Ag.equals("N"))
{
Again = false;
}
}
catch(Exception e)
{
JOptionPane.showMessageDialog(null, "What is '" + input + "'?!?! Enter an actual number.");
}
}
I put the part thats not working as I hope in bold. Its the "if (Ag.equals("N"))". Im trying to make it so if a user inputs "N", then the program will stop running. Otherwise it will loop and keep going. Problem is, even if I type N, it will loop. I am getting no errors. Please help, I am much confuse :(