bannerLabel=new JLabel(new ImageIcon("banner.gif"));
logoLabel=new JLabel(new ImageIcon("logo.gif"));图片放在了同一目录下
logoLabel=new JLabel(new ImageIcon("logo.gif"));图片放在了同一目录下
解决方案 »
- 还是关于synchronized这个关键字的使用!!!急急急急急
- java swing让JPanel的图片自动缩放
- 关于static的疑问
- java Properties IO问题
- 如何调用ECLPSE中的插件
- SWT求教,关于ScrolledComposite
- 请教:有没有什么开源东西,监听虚拟机的?
- 各位大虾:救命了(50,小弟穷哈)
- 求教: 简单的整数加减法
- java中建立oracle连接的问题(oci和thin方式的区别、优劣?)
- 关于String,byte之间的问题
- 当我们的网页中有applet,但我们又没有安JRE时,系统会自己帮我下弹出对话框让我们下sun的,能不能这时指定到局域网内?给分!
import javax.swing.JLabel;
import javax.swing.*;
/**
* <p>Title: </p>
* <p>Description: </p>
* <p>Copyright: Copyright (c) 2003</p>
* <p>Company: </p>
* @author not attributable
* @version 1.0
*/public class tlabel extends JLabel {
ImageIcon ima;
String path = "d://11-5.jpg"; public void repaint(String path){
this.path=path;
repaint();
}
public void paint(Graphics g) {
ima=new ImageIcon(path);
g.drawImage(ima.getImage(),0,0,this.getWidth(),this.getHeight(),Color.BLUE,this); }}
用它试试