
Sir,i took help of coding in how to play audio track in java applet....nd i found perfect code ..but when i run same code on net beans then it shows error that could not found main class file...as u see there is no main claas in this coding then how would i run dis code...and the code is
import java.applet.*;
import java.awt.*;
import java.awt.event.*;
public class PlayAppletSound extends Applet implements ActionListener{
Button play,stop;
AudioClip audioClip;
public void init(){
play = new Button(" Play in Loop ");
add(play);
play.addActionListener(this);
stop = new Button(" Stop ");
add(stop);
stop.addActionListener(this);
audioClip = getAudioClip(getCodeBase(), "TestSnd.wav");
}
@Override
public void actionPerformed(ActionEvent ae){
Button source = (Button)ae.getSource();
if ( " Play in Loop ".equals(source.getLabel())){
audioClip.play();
}
else if(" Stop ".equals(source.getLabel())){
audioClip.stop();
}
}
}

Applets always run on browser.
To compile a program in NetBeans, select Build->Compile from the menu. Alternatively, you can hit the F9 keyboard shortcut. If the compilation is successful, a message "Finished program name" appears in the Output Window.
If you supply an HTML file for your applet, you can launch a browser window from NetBeans to view the applet. Locate the HTML file in the file system explorer and click on it with the right mouse button. Select View from the menu. Your browser is launched and displays the result on the browser.
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.