Create JLabel With Image Icon and Text - Java Swing

Java examples for Swing:JLabel

Description

Create JLabel With Image Icon and Text

Demo Code

 
import javax.swing.ImageIcon;
import javax.swing.JApplet;
import javax.swing.JLabel;
 
public class Main {
       //w w w .  j  a  v  a 2s  .  com
        public void init(){
                ImageIcon icon = new ImageIcon("images/copy.gif");
                JLabel copyLabel = new JLabel("Copy", icon, JLabel.CENTER);
        }
}

Related Tutorials