title: Stop the Player (JLayer) inside a java Thread
body: <p>I have a thread to play an audio but when i close the form i want to stop the player playing the audio file my thread run method is:</p>
  
  <pre><code>public static Player playplayer;
  public static FileInputStream fis;
  public static BufferedInputStream bis;
  public void run(){
     while(!Thread.currentThread().isInterrupted()){
         try{
            String file="E://Net Beans Work Space//The Imran's Regression"
              + "//src//imranregression//audio//iron man.mp3";
            fis= new FileInputStream(file);
            bis= new BufferedInputStream(fis);
            playplayer = new Player(bis);           
            playplayer.play();            
         }catch(Exception e){
               System.out.print("ERROR "+e);
         }
     } 
  </code></pre>
  
  <p>My way of stop my player what i'm doing is:</p>
  
  <pre><code>  private void formWindowClosing(java.awt.event.WindowEvent evt) {                                   
    try{
        BGMusic.fis.close();
        BGMusic.bis.close();
        BGMusic.playplayer.close();      //want to close my player here
        audioplay.interrupt();   //stopping my thread here
  
    }catch(Exception e){
  
        return;
    }
  }    
  </code></pre>
  
  <p>The thing is that it was not doing as i want to do to stop my thread as well as to stop playing the audio. How can i achieve this? Please help me Thanks in advance!         </p>