Java tutorial
import javax.swing.ImageIcon; import javax.swing.JFrame; import javax.swing.JLabel; public class Main { public static void main(String[] args) { JFrame frame = new JFrame("JLabel Test"); frame.setSize(300, 200); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); ImageIcon imageIcon = new ImageIcon("icon.gif"); JLabel label = new JLabel(imageIcon); frame.add(label); frame.setVisible(true); } }