import java.awt.Toolkit;
Toolkit toolkit;
toolkit.beep();

解决方案 »

  1.   

    import java.awt.Toolkit;
    public class sound {
    public static void main(){
    Toolkit toolkit = Toolkit.getDefaultToolkit ();
    toolkit.beep();
    }
    }Exception in thread "main" java.lang.NoSuchMethodError: mainwhy?
      

  2.   

    public static void main(String[] args){
      

  3.   

    好像ibm.com.cn上有一篇关于声音api的文章,具体的我忘了,上去找找,希望适合你
      

  4.   

    String[] args
    呵,和小弟犯一样的错误?
      

  5.   

    方法很多,最简单就是这样,呵呵。public class Beep{
    public static void main(String[] args){
    for(int i=0;i<10;i++){
    System.out.println("\7");
    }
    }
    }
      

  6.   

    JMFPackages
    The Java Sound API includes support for both digital audio and MIDI data. These two major modules of functionality are provided in separate packages: javax.sound.sampled 
    This package specifies interfaces for capture, mixing, and playback of digital (sampled) audio. 
    javax.sound.midi 
    This package provides interfaces for MIDI synthesis, sequencing, and event transport.Two other packages permit service providers (as opposed to application developers) to create custom software components that extend the capabilities of an implementation of the Java Sound API: javax.sound.sampled.spi 
    javax.sound.midi.spi The rest of this chapter briefly discusses the sampled-audio system, the MIDI system, and the SPI packages. Each of these is then discussed in detail in a subsequent part of the guide.
      

  7.   

    dont know
    不过进来了还是up一下吧
      

  8.   

    简单的就是这两种了。
    getToolkit().beep();
    System.out.println('\007');//bell如果是要发别的声音,那就要用
    AudioClip enterfile,opendir;
    enterfile=Applet.newAudioClip(getClass().getResource("sound\\enterfile.wav"));
    opendir=Applet.newAudioClip(getClass().getResource("sound\\opendir.wav"));
    enterfile.play();
      

  9.   

    System.out.println('\007');是让扬声器发声;
    toolkit.beep();是让声卡发声;
      

  10.   

    import java.awt.Toolkit;
    public class sound {
    public static void main(String[] args){
    Toolkit toolkit = Toolkit.getDefaultToolkit ();
    toolkit.beep();
    }
    }
     
     OK!
      

  11.   

    好像JAVA中,只有这两种解决方法了吧。GOOD LUCK  !!!