why does my program give me a NullPointerException when i press the CANCEL button? what can i do to make it close down the dialog when the cancel buttong is pressed?
thank you
Hristo
private String promptForSchoolName()
{
String name = "";
while(name.length() == 0)
{
name = JOptionPane.showInputDialog("Enter school name:");
if(name.length() == 0)
{
JOptionPane.showMessageDialog(null, "Invalid input.");
}
}
return name;
}