posted 20 years ago
You can make the icon yourself by just by making a class that implements Icon and takes a Color, and just paints a rectangle of that color in the paintIcon() method. JLabels can have both text and an Icon, so you can just set them both in a JLabel. The default is for the icon to be on the left of the text on the label, so you won't have to mess with setting any of that differently.
-Nate
Write once, run anywhere, because there's nowhere to hide! - /. A.C.