Library events?
in
Library and Tool Development
•
9 months ago
I've tried searching the forum for a solution to this but I'm stumped! I'm following the guidelines posted here to create library events:
http://code.google.com/p/processing/wiki/LibraryBasics#Adding_Your_Own_Library_Events
To create my own library events but for some reason my library can't find the 'fancyMethod' method in my applet? My code is taken straight from the example posted on the above page? My contructor looks like this:
try {
fancyEventMethod =
myParent.getClass().getMethod("fancyEvent",
new Class[] { Csoundo.class });
} catch (Exception e) {
System.out.println("no such method...");
// no such method, or an error.. which is fine, just ignore
}
But fancyEventMethod is always NULL? In my processing code I have the following method:
void fancyEvent() {
println("works!!!");
}
I can't see why getClass().getMethod() is returning NULL when the method clearly exists? Any ideas?
http://code.google.com/p/processing/wiki/LibraryBasics#Adding_Your_Own_Library_Events
To create my own library events but for some reason my library can't find the 'fancyMethod' method in my applet? My code is taken straight from the example posted on the above page? My contructor looks like this:
try {
fancyEventMethod =
myParent.getClass().getMethod("fancyEvent",
new Class[] { Csoundo.class });
} catch (Exception e) {
System.out.println("no such method...");
// no such method, or an error.. which is fine, just ignore
}
But fancyEventMethod is always NULL? In my processing code I have the following method:
void fancyEvent() {
println("works!!!");
}
I can't see why getClass().getMethod() is returning NULL when the method clearly exists? Any ideas?
1