JLabel with ImageIcon

The swing icons are encapsulated by ImageIcon class. This class paints an image from the image. ImageIcon(String filename) Program       Program Source import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.ImageIcon; import java.awt.FlowLayout; class Frame extends JFrame{ Frame() { setTitle(“ImageIcon”); setLayout(new FlowLayout()); setLabel(); setSize(700, 200); setVisible(true); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); } private void setLabel() { ImageIcon icon = new … Read more…