Create JLabel With Image Icon - Java Swing

Java examples for Swing:JLabel

Description

Create JLabel With Image Icon

Demo Code

 
import javax.swing.ImageIcon;
import javax.swing.JApplet;
import javax.swing.JLabel;
 
public class Main {
       /*from  ww  w . j av a  2  s.c o  m*/
        public void init(){
               
                ImageIcon icon = new ImageIcon("images/copy.gif");
               
                JLabel copyLabel = new JLabel(icon);
               
        }
}

Related Tutorials