Use of Icons
Icons can be used in various places. Buttons, labels and related components generally allow an icon to be displayed in addition to or in place of a text label:
JButton(String label, Icon icon) // Text and icon
JMenuItem(String label, Icon icon) // Text and icon
JLabel(Icon icon) // Just icon
Icons are usually loaded from image files, e.g.
Icon icon = new ImageIcon(“icon.gif”) ;