package o; import java.awt.Graphics; import java.net.URL; import javax.swing.ImageIcon; import javax.swing.JLabel; public class o_image extends JLabel{ private static final long serialVersionUID = 1L; private String imgUrl; public o_image(){} public o_image(String imgUrl){ this.imgUrl=imgUrl; } public void setImgUrl(String imgUrl){ this.imgUrl=imgUrl; } protected void paintComponent(Graphics g) { if(null==imgUrl || "".equals(imgUrl)){ return; } URL url=this.getClass().getResource(imgUrl); ImageIcon icon = new ImageIcon(url); g.drawImage(icon.getImage(), 0, 0, getWidth(), getHeight(), icon.getImageObserver()); } }

1979969842 LV12
2021年6月26日
最代码官方 LV168
2020年7月6日

krispeng LV14
2024年12月18日
内心向阳 LV4
2023年11月8日
jkjfdgbkl LV2
2023年11月1日
微信网友_6444139264921600 LV8
2023年4月29日
yiyi2000
2023年1月27日
暂无贡献等级
微信网友_6191697646571520 LV6
2022年11月23日
lxsnh123 LV3
2022年11月18日
123456qiqiqi LV1
2022年5月27日
wyx065747 LV67
2022年5月7日
1265260263 LV4
2022年4月8日