If you actually take care to correct the indentation of your code the problem will likely show itself:
public static void main(String[] args)
{
boolean runAgain = true;
while(runAgain){
runMyCode();
JOptionPane.showInputDialog( null, " Would you like to exit the application? Enter (y) to exit or any other key to continue ");
}
String Answer = " ";
char answer = Answer.charAt(0);
if (answer == 'y'){
runAgain = true;
}
else {
runAgain = false;
}
}