I have a method
public void setSalary(int salary) {
this.salary = salary;
}
//The method above is called from the method below. They are in two seperate classes. I want to display an error message if salaryTxt is not an integer.
// However I don't know how to do this because I cant display the
string to the screen from the method above. I need to do it from the method below. The method above does not
//have access to the label I want to print the error message out on.
private void submitButtonActionPerformed(java.awt.event.ActionEvent evt) {
Employee e = new Employee();
e.setSalary(Integer.parseInt(salaryTxt.getText()));
}
Any suggestions appreciated.