Java程序设计
import java.awt.*; import java.awt.event.*; import java.applet.*; import java.net.MalformedURLException; import java.net.URL; import java.util.logging.Level; import java.util.logging.Logger; public class Displayaudio extends Applet implements ActionListener { private Button play=new Button("display");; private Image imag e,image2=null; private AudioClip audioClip=null; public void init() { try { image2=getImage(new URL("http://www.100gaoxiao.com/uploads/allimg/110518/1_110518150403_3.jpg")); } catch (MalformedURLException ex) { Logger.getLogger(Displayaudio.class.getName()).log(Level.SEVERE, null, ex); } add(play); play.addActionListener(this); try { audioClip = getAudioClip(new URL("http://www.dabaoku.com/bjyinyue/mid/600.mid")); } catch (MalformedURLException ex) { Logger.getLogger(Displayaudio.class.getName()).log(Level.SEVERE, null, ex); } } e,image2=null; private AudioClip audioClip=null; public void init() { try { image2=getImage(new URL("http://www.100gaoxiao.com/uploads/allimg/110518/1_110518150403_3.jpg")); } catch (MalformedURLException ex) { Logger.getLogger(Displayaudio.class.getName()).log(Level.SEVERE, null, ex); } add(play); play.addActionListener(this); try { audioClip = getAudioClip(new URL("http://www.dabaoku.com/bjyinyue/mid/600.mid")); } catch (MalformedURLException ex) { Logger.getLogger(Displayaudio.class.getName()).log(Level.SEVERE, null, ex); } }
用户评论