Topic: Applet怎么这么慢啊--不解。。。

  Print this page

1.Applet怎么这么慢啊--不解。。。 Copy to clipboard
Posted by: wind520sand
Posted on: 2005-06-01 08:03

*========================Pragramme Design=============================*/
/* @程序说明:使用AudioClip类控制播放的音乐文件 */
/* @程序目的:线程的运用 */
/* @Writen by :kanker007 */
/* @Date:2005-05-11 */
/*=====================================================================*/
/*---------------------------------------------------------------------*/
/* 代码区 */
/*---------------------------------------------------------------------*/

import java.awt.*;
import java.awt.event.*;
import java.applet.Applet;
import java.applet.AudioClip;

public class Lx extends Applet implements ItemListener,ActionListener
{
AudioClip sound;
Choice c=new Choice();
Button play=new Button("播放");
Button loop=new Button("连续");
Button stop=new Button("停止");

public void init(){
c.add("1.wav"); c.add("2.wav"); c.add("3.wav");
addCoffee;
c.addItemListener(this);
add(play);add(loop);add(stop);

play.addActionListener(this);
loop.addActionListener(this);
stop.addActionListener(this);

sound=getAudioClip(getCodeBase(),"1.wav");
sound.play();

}

public void itemStateChanged(ItemEvent e){
sound.play();
//sound=getAudioClip(getCodeBase(),c.getSelectedItem());//"WAV/"+

}

public void actionPerformed(ActionEvent e){
if(e.getSource()==play) sound.play();
else if(e.getSource()==loop) sound.loop();
else if (e.getSource()==stop) sound.stop();
}
}

我靠我运行了。可是超级郁闷啊。慢得声音一顿一顿的。CPU占用100%,内存也直接上到240多啊!怎么回事啊!请大家看看

2.Re:Applet怎么这么慢啊--不解。。。 [Re: wind520sand] Copy to clipboard
Posted by: wind520sand
Posted on: 2005-06-01 19:27

难道没人知道吗?大家来关心一下哦
版主呢?站长呢?指点一下啊


   Powered by Jute Powerful Forum® Version Jute 1.5.6 Ent
Copyright © 2002-2021 Cjsdn Team. All Righits Reserved. 闽ICP备05005120号-1
客服电话 18559299278    客服信箱 714923@qq.com    客服QQ 714923