title: How do you call Scala objects from Java?
body: <p>Java code:</p>
  
  <pre><code>import javax.swing.Timer;
  class Main { 
      public static void main(String args[]) {
      MyListener myListener = new MyListener();
          Timer timer = new Timer(1000, myListener);
      timer.start();
          while(timer.isRunning()) {
              System.out.print(".");
          }
      }
  }
  </code></pre>
  
  <p>Scala code:</p>
  
  <pre><code>import java.awt.event.ActionListener;
  import java.awt.event.ActionEvent;
  class MyListener extends ActionListener {
      override def actionPerformed(arg0: ActionEvent) {
          println("Do something");  
      }
  }
  </code></pre>
  
  <p>Command line:</p>
  
  <pre><code>scalac MyListener.scala
  javac Main.java
  java -cp /usr/share/java/scala-library.jar:. Main
  </code></pre>