Dynamically change jButton icon

后端 未结 5 1273
Happy的楠姐
Happy的楠姐 2021-01-19 22:14

I have a program that detects when certain machines are online and creates a button with a green \"online\" icon to show this. I want to add the functionality to check perio

5条回答
  •  暗喜
    暗喜 (楼主)
    2021-01-19 22:44

    btn1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/url.png")));
    

提交回复
热议问题