Set Icon for JLabel - Java Swing

Java examples for Swing:JLabel

Description

Set Icon for JLabel

Demo Code

 
import javax.swing.ImageIcon;
import javax.swing.JApplet;
import javax.swing.JLabel;
 
public class Main {
       //from  w w w  . j a va 2  s.c  om
        public void init(){
                JLabel label1 = new JLabel("JLabel Set Icon.");
                label1.setIcon(new ImageIcon("images/copy.gif"));
        }
}

Related Tutorials