title: What is the best/easiest solution to have an action executed for a button click?
body: <p>I'm working on Processing to create my own API, with buttons and such. Yet I did the button, and I did everything about testing when your mouse is over the button,... But the thing is, I don't really know how to launch a method for the action of the button.</p>
  
  <p>I saw how the basic Java API is doing -with ActionListener and such- but I just don't like it. I wan't my own code - or at least à code I understand.</p>
  
  <p>So I want a Button that launch a method when it is clicked, I've got a boolean (true when the mouse is hovering it... That works fine).</p>
  
  <p>I found some things about the reflection API, and using method.invoke();, but some people where saying that was slowing down the program or being dangerous for private methods.</p>
  
  <p>I saw something about someone talking about method(); whitch apparently can be used to invoke a method ? I searched for it and didn't found anything more.</p>
  
  <p>So it's more a thought question than a code question, I'm not asking for code, but more, how would you create a Button that anybody could use and that will have a certain action symbolized by a method. And more precisely how to launch that method.</p>