title: Java Jlayer Mp3 Player - how to repeat and stop song
body: <p>I have problem with mp 3 player. I'm using jLayer.
  This is my code</p>
  
  <pre><code>private void formWindowOpened(java.awt.event.WindowEvent evt) {                                  
  
  new Thread (){
    public void run(){  
            try
  {
  
  Player prehravac;
   FileInputStream buff = new FileInputStream(Okno.filename);
              prehravac = new Player(buff);
              prehravac.play();
              if (prehravac != null)
              {
                  prehravac.play();
              }
              }
  catch(Exception e)
          {
  
          } 
           }
  
  }.start();
   }  
  </code></pre>
  
  <p>In my application I need to play song from the beginning to the end. So when song ends I need to start it again and when window closes I want to stop this song...</p>