Every time I am trying to load an image file to give an icon to my JButton
, Java shows a null pointer exception. I have Checked the directories The image is present.
Can you please help me out?
Here is my code.
jButton1.setIcon(new ImageIcon(getClass().getResource("/Users/Stallion/Yo/Key-50.png " )));
Aucun commentaire:
Enregistrer un commentaire