if (e.getSource () == btnControls)
{
JOptionPane.showMessageDialog (null, "Movement: " + "\n" + "To move Megaman you choose either to move up or down buttons. Your character (Megaman) will start on the bottom left of the screen. \n\nAttacking: \nAfter selecting where you want Megaman to go, select a type of attack. Each attack has different effects and amounts of damage therefore should be used strategically. \nWhen you are done selecting an attack, select the area (up or down) you want the attack to go. \n Mega Buster is your standard attack, doesn't take much stamina while still doing decent and consistent damage. \nCyber Sword hits hard if you're, but has a random damage rate and takes a lot more stamina. \nPower Up being your most essential attack, it recovers stamina as well as health, but you can't deal ANY damage so choose carefully when you want to use it. \nCharged Shot is your special attack, which you can use when you have 100 stamina. \n Charged Shot never misses, and takes away 1/3 of your opponents health though it does take all 100 points of stamina. ");
}

if (e.getSource () == btnHelp)
{
JOptionPane.showMessageDialog (null, "Your main objective is to deal enough damage to reduce your opponent's (Bass') health to zero. \nYou can do this in a variety of ways such as using the powerful yet random Cyber Sword, or \nuse your consistent Mega Buster OR power up til you have 100 stamina to unleash Charged Shot! \nYour score is determined on how much damage you deal to the enemy and how many turns it takes for you to delete your opponent. \nThe shorter it takes for you to beat the enemy or the more damage you deal will give you a better score.");
}

That is all of my code for my game. Now the error... So whenever the player wins or loses, the dialogues with "score saved" and "enter your name here" appear. But whenever I try to type in a name in that dialogue box "Please enter your name here" I always get my try..catch error (exception) so the name and score is never saved into the .txt file I want it saved in. When I take out the:
catch (Exception e)
{
JOptionPane.showMessageDialog (null, "UNKOWN ERROR!", "ERROR", JOptionPane.ERROR_MESSAGE);
System.exit(0);
}
it always gives me the error
"The constructor "FileWriter" can throw the checked exception "java.io.IOException, so the class creation must be enclosed in a try statement that catches the exception, or else this method must be declared to throw the exception."