import java.awt.Toolkit;
Toolkit toolkit;
toolkit.beep();
Toolkit toolkit;
toolkit.beep();
解决方案 »
- 文本编辑器出错? 请各位帮帮忙
- 怎样通过url查看cxf发布的web service?
- ojdbc14.jar与classes12.jar有什么区别???????????????
- struts+mysql的中文乱码问题,急!
- struts+hibernate查询数据问题
- jsp里面table有行数据怎么上传给action 求高手指点!!!
- 我用ant生成一个不带main方法的jar包,如何在linux上部署运行啊,求大神
- !!!郁闷ing,怎样用Tomcat发布一个简单的HelloWorld应用程序!!!
- 关于用ANT编译的时候出现的问题。急
- 请问JAVA的反问功能是什么?????
- 运行struts的例子报错,不知何解
- 在java中如何让机器发声?(在线等待,解决了马上送分)
public class sound {
public static void main(){
Toolkit toolkit = Toolkit.getDefaultToolkit ();
toolkit.beep();
}
}Exception in thread "main" java.lang.NoSuchMethodError: mainwhy?
呵,和小弟犯一样的错误?
public static void main(String[] args){
for(int i=0;i<10;i++){
System.out.println("\7");
}
}
}
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.
不过进来了还是up一下吧
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();
toolkit.beep();是让声卡发声;
public class sound {
public static void main(String[] args){
Toolkit toolkit = Toolkit.getDefaultToolkit ();
toolkit.beep();
}
}
OK!