title: Call a function by its name, given from string java
body: <p>I would like to be able to call a function based on its name provided by a string. Something like</p>
  
  <pre><code>public void callByName(String funcName){
     this.(funcName)();
  }
  </code></pre>
  
  <p>I have searched a bit into lambda funcions but they are not supported. I was thinking about going for Reflection, but I am a bit new to programming, so I am not so familiar with the subject.</p>
  
  <p>This whole question was brought up on my java OOP class, when I started GUI (Swing, swt) programming, and events. I found that using <code>object.addActionCommand()</code> is very ugly, because I would later need to make a Switch and catch the exact command I wanted.</p>
  
  <p>I would rather do something like <code>object.attachFunction(btn1_click)</code>, so that it would call the <code>btn1_click</code> function when the event click was raised.</p>