Hello,
The problem is simple: One of your fields is empty so the appeal champs.getText () returns "". Then Parse fails and launches the exception. As we told you use try catch to find the error / avoid the crash program.
Code:
try
{
a = Integer.parseInt (champs.getText ());
/ / Process a normal
}
catch (NumberFormatException e)
{
/ / Here you can write code for error handling, for example e.printStackTrace () to display the error in your error console or a beast System.out.println ( "Goal 1 planted);
}
Bookmarks