smiley
save Smiley To Project Folder
- download this image:
- to your project folder as shown below: HardDrive\users\%username%\NetBeansProjects\projectName\ ... (put image here) ... :
setup Form
import Package
- put the following imports at the very top (i.e. on the first two lines, so that everything else is moved down) of your Source code:
import java.io.File;
import javax.swing.ImageIcon;
btnShow
String smilePath = new File("").getAbsolutePath() + "/smiley.png";
ImageIcon smileImage = new ImageIcon(smilePath);
lblPicture.setIcon(smileImage);