2009-09-09 2 views
1
import java.applet.*; 

/** 
* SoundApplet.java - a simple applet that plays the "gong.au" sound file. 
*/ 
public class AppletGame extends Applet 
{ 

    public void init() 
    { 
    super.init(); 
    resize(0,0); 

    AudioClip gong = getAudioClip(getDocumentBase(), "test0.au"); 
    gong.play(); 
    } 
} 

Eclipse 애플릿 뷰어에서는로드되어 소리가 재생되지 않습니다. HTML에서는로드되지 않고 초기화되지 않는다고 말합니다. 나는 초기화 (init) 밖에서 그것을 호출하려고 시도했다.간단한 자바 사운드 애플릿이 작동하지 않습니다 !!! ARG!

답변