hi
i have a java code which plays audio file. the control panel components are added to the code. but i am not able to display the control panel in my jframe. how should i do that. This code opens the components in a separate frame and plays the file. i want to integrate it with my code. i want the audio panel (play pause buttons, slider) to be displayed in my jframe (say frm1).Can anyone pls help. i ve my code below. kindly help me.
Java Code:
// MediaPlayer.java

import javax.media.*;

import java.awt.*;
import java.awt.event.*;
import java.io.*;
//import javazoom.jl.decoder.*;
//import javazoom.jl.player.Player;
 

class MediaPlayer extends Frame implements ControllerListener,
                                           ItemListener
{
   Player player;
   Component vc, cc;
   boolean first = true, loop = false;

  //String currentDirectory;

   MediaPlayer ()
   {
      //super (title);

     
 addWindowListener
                (new WindowAdapter ()
                 {
                     public void windowClosing (WindowEvent e)
                     {
                        // User selected close from System menu.
                        // Call dispose to invoke windowClosed.

                        dispose ();
                     }

                     public void windowClosed (WindowEvent e)
                     {
                        if (player != null)
                            player.close ();

                        System.exit (0);
                     }
                 });
      setSize (200, 200);

      setVisible (true);

     
     
   }

   public void play()
   {
      String filename = "c:/program files/java/jdk1.6.0/bin/demo.wav"; 
         
     File f1 = new File(filename);

     if (player != null)
          player.close ();
 
      try
      {
         player = Manager.createPlayer (new MediaLocator
                                           ("file :" + f1));
      }
      catch (java.io.IOException e2)
      {
         System.out.println (e2);
         return;
      }
      catch (NoPlayerException e2)
      {
         System.out.println ("Could not find a player.");
         return;
      }

      if (player == null)
      {
          System.out.println ("Trouble creating a player.");
          return;
      }

      first = false;

      setTitle ("demo.wav");

      player.addControllerListener (this);
      player.prefetch ();
   }

   public void controllerUpdate (ControllerEvent e)
   {
      
      if (e instanceof ControllerClosedEvent)
      {
          if (vc != null)
          {
              remove (vc);
              vc = null;
          }

          if (cc != null)
          {
              remove (cc);
              cc = null;
          }

          return;
      }

      if (e instanceof EndOfMediaEvent)
      {
          if (loop)
          {
              player.setMediaTime (new Time (0));
              player.start ();
          }

          return;
      }

      if (e instanceof PrefetchCompleteEvent)
      {
          player.start ();
          return;
      }

      if (e instanceof RealizeCompleteEvent)
      {
          vc = player.getVisualComponent ();
          if (vc != null)
              add (vc);

          cc = player.getControlPanelComponent ();
          if (cc != null)
              add (cc, BorderLayout.SOUTH);

          pack ();
      }
   }

   public void itemStateChanged (ItemEvent e)
   {
      loop = !loop;
   }

  
   
   public static void main (String [] args)
   {
     // new MediaPlayer ("Media Player 1.0");
	  MediaPlayer m1 = new MediaPlayer();
	  m1.play();
	  
   }
}