Hey I have a panel that contains a label that i have to change it's icon everythime i click on a button ( there are 2 buttons here activate and disactivate ) .and these 2 images that i want to set as icons are in my ressources under a backage called "imgs".
Example : imgs/img_x.png so who to change that icon ? cause i always get a null pointer exception.
i need that in java not in Android
Thanks
Icon c=new ImageIcon(getClass().getResource("src/imgs/img_not_activated.png"));
img_etat_pharmacie.setIcon(c);
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…