How to use the Reflection API?
in
Programming Questions
•
7 months ago
Hi!
How to invoke a Method from another Class?
I actually don't really know if this is the correct Question because i don't know how this technique is called.
I guess it has something to do with the Refelction API.
For instance, if we use the sDrop library, it looks like:
drop = new SDrop(this);
(...)
void dropEvent(DropEvent theDropEvent) {
println(theDropEvent.isFile());
(...)
}
How can i accomplish something similar?
Like defining my own mouseClicked, call it clickEvent...
void setup(){
MyClass myC = new MyClass(this);
}
void draw(){ }
void clickEvent(EventClass event){
println( event.printHello() );
}
output:
"Hello World."
"Hello World."
"Hello World."
thx
1