When I try to compile and run this section of code, I get this erro:
Exception in thread "AWT-EventQueue-0" java.lang.Error: Unresolved compilation problem: listener cannot be resolved to a variable
at FormPanel.setFormListener(FormPanel.java:273)
at MainFrame.<init>(MainFrame.java:37)
at App$1.run(App.java:10)
The code is this:
// public void setFormListener(DailyFormListener listener) {
// this.formDayListener = listener;
//
// }
public void setFormListener(Object o) {
if (o instanceof DailyFormListener) {
this.formDayListener = listener;
}
else if (o instanceof GeneFormListener) {
this.geneFormListener = listener;
}
else if (o instanceof LabFormListener) {
this.labFormListener = listener;
}
}
That is from the line 273 section. My question is, it works when run with the section above that is commented out, but now in the section that is uncommented. What do I need to change to allow setFormListener to be general enough to handle this? I can provide more code or information as needed.