Hi I’ve been Looking for a way to create a method wich uses an other method for calculating stuff. As I surfed I found that there are methods in specific classes wich can do this for Example in the Library java.awt.event.ActionListener, where you can add a actionListener to a JButton.
It works like this:
You can edit your post, if you posted something wrong.
As for what you are looking for… you are looking for a way to use any method as a Parameter, correct? If so, try using java.lang.reflect.Method class as a parameter. It does pretty much all you are looking for, if i got you right.
In the AWTEvent class is what takes the method as an object, though that might be wrong… but that‘s as far as i was able to trace the way of that Code back… So it could actually be anything within AWTEvent class… well, i think it‘s this one.