Below code shows how to set an icon in a JLabel import java.awt.FlowLayout; import javax.swing.JFrame; import javax.swing.JLabel; impo...
Below code shows how to set an icon in a JLabel
import java.awt.FlowLayout; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.ImageIcon; public class JTextFieldSetBorder extends JFrame{ JTextFieldSetBorder() { super("JTextField Examples"); JLabel label=new JLabel(new ImageIcon("icons/report.png")); add(label); setSize(300,300); setLayout(new FlowLayout()); setVisible(true); } public static void main(String args[]) { new JTextFieldSetBorder(); } }