patricktwo
Programmer
I am writtin a proggram for a class, I have to use exceptios. I have written this:
public void checkFirstNameInput()
{
try
{
if(sFirstName.length() == 0)
throw new FirstNameException("No Entry"
inputLastName.requestFocus();
}
catch (FirstNameException e)
{
JOptionPane.showMessageDialog(frame, "You must enter a valid name!", e.getMeesage, JOptionPane.ERROR_MESSAGE);
inputFirstName.requestFocus();
}
I get an error message "cannot resolve symbol" in both places that the exception is named.
public void checkFirstNameInput()
{
try
{
if(sFirstName.length() == 0)
throw new FirstNameException("No Entry"
inputLastName.requestFocus();
}
catch (FirstNameException e)
{
JOptionPane.showMessageDialog(frame, "You must enter a valid name!", e.getMeesage, JOptionPane.ERROR_MESSAGE);
inputFirstName.requestFocus();
}
I get an error message "cannot resolve symbol" in both places that the exception is named.