Swing labels and buttons—represented by the
JButton classes, respectively—are simple components that are capable of displaying text or an icon.
Labels by default do not have a border and display a string, an icon, or both. Besides being useful for rather mundane purposes such as adorning text fields, Swing labels also fulfill the role of image canvas (a component that displays an image). Because AWT images are not components, they cannot be added to a container. As a result, many different variations of an ...