摘要: import java.awt.event.KeyEvent;import java.awt.event.KeyListener;import javax.swing.JFrame;/** To change this template, choose Tools | Templates* and open the template in the editor.*/import javax.swing.JPanel;import javax.swing.JTextField;/**** @author李效伦*/public class HOHO extends JFrame implement 阅读全文
posted @ 2012-12-13 12:48 Entropy_lxl 阅读(1682) 评论(0) 推荐(0) 编辑
摘要: JFame.setIconImage(Toolkit.getDefaultToolkit().creatImage(fileName));fileName是String类型,是图片文件的名字及路径 阅读全文
posted @ 2012-12-13 10:56 Entropy_lxl 阅读(318) 评论(0) 推荐(0) 编辑
摘要: JLabel background = new JLabel(new ImageIcon(url));//url代表你图片的路径this.add(background)即可//将你的jlabel背景加到jframe上当然jframe也有专门的设置背景的复方法,忘掉了,你查一下最好下一个JDK -API手册,一查便知 阅读全文
posted @ 2012-12-13 10:55 Entropy_lxl 阅读(7987) 评论(0) 推荐(0) 编辑
摘要: File musicFile=new File("所要添加的音乐名");URI uri=musicFile.toURI();URL url=uri.toURL():AudioClip=Applet.newAudioClip(url);控制音乐的播放与停止clip.play();clip.stop(); 阅读全文
posted @ 2012-12-13 10:54 Entropy_lxl 阅读(2001) 评论(0) 推荐(0) 编辑