zhuhengjie

如何咋java 中添加图片:

有一种简单的方法

<span style="color:#3333ff;">private ImageIcon userface = new ImageIcon("src/images/logo.png");
private JLabel userfacelabel = new JLabel(userface);
public static Container contentPane;
contentPane.add(userfacelabel);// 用户头像
userfacelabel.setBounds(150, 230, 40, 40);</span>
注意:这里的图片位置要用当前工作站先得路径,也可以是绝对路径


java实战练习eclipse连接mysql数据库



分类:

技术点:

相关文章:

  • 2021-10-24
  • 2021-07-20
  • 2021-05-10
  • 2021-11-23
  • 2022-12-23
猜你喜欢
  • 2021-12-27
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-06-09
  • 2022-12-23
  • 2022-01-08
相关资源
相似解决方案