1. Home >
  2. Apps >
  3. Groups >

need media plalyer source code in java....

Question asked by yadavundertaker mohit in #Java on Nov 18, 2009
yadavundertaker mohit
yadavundertaker mohit · Nov 18, 2009
Rank B2 - LEADER
can somebody provide me
source code of media player in java
i need to submit as my project and i have no lead
so if any one can
then please help Posted in: #Java
Mahesh Dahale
Mahesh Dahale · Nov 19, 2009
Rank B2 - LEADER
This was my MCA FY Project it will help you

   import java.awt.*;
  import java.applet.*;
  import java.net.*;
   
  public class soundApplet extends Applet
  {
              List lst;
              Button Play,Stop,Loop;
              AudioClip au;
              public void init()
              {
                          setLayout (new GridLayout());
   
                          Panel listPanel = new Panel();
                          Panel buttonPanel = new Panel();
   
                                      add ("Center", listPanel);
                                      add ("Left", buttonPanel);
   
                          listPanel.setLayout (new GridLayout());
   
                                      lst = new List();
                                         lst.addItem ("intel54");
   
                                      lst.addItem ("Windows XP Startup");
   
                                      lst.addItem ("Windows XP Shutdown");
   
                                      lst.addItem ("hi");
   
                                      lst.addItem ("notify");
                                      lst.select (0);
   
                          listPanel.add ("Center", lst);
   
                          Play = new Button ("Play");
   
                                      buttonPanel.add (Play);
   
                          Stop = new Button ("Stop");
   
                                      buttonPanel.add (Stop);
   
                          Loop = new Button ("Loop");
   
                                      buttonPanel.add (Loop);
              }
              public boolean action (Event evt, Object obj)
              {
                          String strSelection = lst.getSelectedItem() + ".au";
   
                          URL codeBase = getCodeBase();
   
                          au = getAudioClip (codeBase, strSelection);
   
                          if (evt.target == Play)
                                      au.play();
   
                          if (evt.target == Stop)
                                      au.stop();
                          if (evt.target == Loop)
                                      au.loop();
   
                                      return true;
                          }
              }
  
For HTML page

   
  
  
   
   Sound Applet 
  
   
  
  

Sound Applet





[​IMG]
yadavundertaker mohit
yadavundertaker mohit · Nov 19, 2009
Rank B2 - LEADER
thanks mahesh...
oldboy1985
oldboy1985 · Nov 19, 2009
Rank E1 - BEGINNER
thanks
i also needed that one

You must log-in or sign-up to reply to this post.

Click to Log-In or Sign-Up