I am working on a swing application in netbeans. I created one parent class and a child class. Whenever I call any attribute of the parent class through the child class, I get an error. How to solve it:
this is the parent class:
public abstract class WorkRequest {
private String name;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}}
this is a child class:
public class DoctorTestWorkRequest extends WorkRequest {
private String message;
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
I call the child class in the panel:
DoctorTestWorkRequest request = new DoctorTestWorkRequest();
request.setName(name);
request.setMessage(message);
I get an exception:
Exception in thread "AWT-EventQueue-0" java.lang.NoSuchMethodError: Business.WorkQueue.DoctorTestWorkRequest.setName(Ljava/lang/String;)V
at UserInterface.ReceptionistRole.DoctorTestWorkRequestJPanel.requestTestJButtonActionPerformed(DoctorTestWorkRequestJPanel.java:147)
How to solve it. thank you in advance
source
share