title: Cannot close applet in eclipse
body: <p>I have an applet that runs VLCJ (http://code.google.com/p/vlcj/) - basically embedding a VLC player in an applet. 
  When running in eclipse, it runs well but I cannot close the debugging applet-window or terminate it somehow. I wonder, why is this? Is there anything in the code that prevents it from stopping debugging? I have to restart eclipse in order to make it quit. Im quite sure you dont need to add destroy() to enable closing of the debugging window.</p>
  
  <p>Thanks</p>
  
  <pre><code>import java.awt.BorderLayout;
  import java.awt.Canvas;
  import java.awt.Frame;
  import javax.swing.JApplet;
  import java.awt.event.WindowAdapter;
  import java.awt.event.WindowEvent;
  
  import com.sun.jna.NativeLibrary;
  
  import uk.co.caprica.vlcj.player.MediaPlayerFactory;
  import uk.co.caprica.vlcj.player.embedded.EmbeddedMediaPlayer;
  
  
  public class Main extends JApplet {
  
      /**
       * @param args
       */
      /* entry point */
      public void init() {
          String file = "110825-155446.wmv";    // only 2-3 seconds clip for minimum storage      
          runVideo(file);
      }
  
      /* runs the video file */
      public void runVideo(String file) {
  
          setSize(400,300);
          setLayout(new BorderLayout()); 
          Canvas vs = new Canvas();
          add(vs,BorderLayout.CENTER);
          setVisible(true);
  
          MediaPlayerFactory factory = new MediaPlayerFactory();
  
          EmbeddedMediaPlayer mediaPlayer = factory.newEmbeddedMediaPlayer();
          mediaPlayer.setVideoSurface(factory.newVideoSurface(vs));
  
          mediaPlayer.playMedia(file);
          try {
              Thread.currentThread().join();
          } catch (InterruptedException e1) {
              // TODO Auto-generated catch block
              e1.printStackTrace();
          }
  
      }
  
  
  }
  </code></pre>