title: Pass Java-method-call to Scala class/method
body: <p>I have to work with this huge monolithic code that was written in Java and has hundreds of code-repetitions like:</p>
  
  <pre><code>createButtonOne() {
      ... 
      public boolean pressed() {
          doSomething();
          return true;
      }
  }
  
  createButtonTwo() {
      ...
      public boolean pressed() {
          doAnotherThing();
          return true;
      }
  }
  </code></pre>
  
  <p>The code literally is the same apart from the function that is called, but it's rather annoying. Of course I could outsource great parts of the methods but this would cost me more time than doing it right with better tools. Or so I thought.</p>
  
  <p>What I want to do is this:</p>
  
  <pre><code>ScalaButton buttonOne = new ScalaButton();
  buttonOne.create("Label", Controller.doSomething());
  
  ScalaButton buttonTwo = new ScalaButton();
  buttonTwo.create("Label2", Controller.doAnotherThing());
  </code></pre>
  
  <p>Therefore I created ScalaButton as follows:</p>
  
  <pre><code>class ScalaButton
  {
      def create(label:String, action: () =&gt; Unit): Unit = 
      {
          val button:Button = singletonCreator.createButton(label);
          button.addListener(new InputListener()
          {
              override def pressed(...)
              {
                  action()
                  true
              }
          }
  }
  </code></pre>
  
  <p>The problem is that I've never done this call from Java and it says </p>
  
  <blockquote>
    <p>found void, required scala.Function0</p>
  </blockquote>
  
  <p>So I wonder, is it even possible to pass a java-method call to Scala this (or another) way? I haven't worked with Java in a few months and never used it alongside Scala in this way...</p>