首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > JAVA > Eclipse开发 >

求eclipse如何搭建JMF SWT的作用

2012-09-20 
求eclipse怎么搭建JMFSWT的作用如题[解决办法]JMF(Java Media Framework):位于JMF提供的多媒体包为:javax.

求eclipse怎么搭建JMF SWT的作用
如题  


[解决办法]
JMF(Java Media Framework):
位于JMF提供的多媒体包为:javax.media。支持 AIFF, AU, AVI, GSM, MIDI, MPEG, QuickTime, RMF 和 WAV等格式的文件. 在Sun公司的网站下载并安装Jmf2.1


1、创建一个播放器(Player)
Player类:在javax.media包中,使用该包中的Manager类调用createPlayer()方法创建播放器。
 1)对于Applet小程序,创建播放器如下:
try{ URL url=new URL(getDocumentBase(), ××.avi);
Player player=Manager.createPlayer(url);
}catch(IOException e){ }
2)对于Application程序,创建播放器如下:
try{ File file=new file(“××.avi”):
URL url=file.toURL;
Player player=Manager.createPlayer(url);
}catch(IOException e){ }

热点排行