longVal = Long.parseLong(temp.getText());
} catch (NumberFormatException err) {
JOptionPane.showMessageDialog(this, "This field must have a long value!", "Value Required",
JOptionPane.ERROR_MESSAGE);
temp.setText(defaultValue);
temp.requestFocusInWindow();
}
return longVal;
}
}