Jump to Real's How-to Main page

Change JLabel background color

The JLabel background is transparent by default, so changing the background color doesn't seem to do anything. Do something like this :
aJLabel.setOpaque(true);
aJLabel.setBackround(myColor)

If you find this article useful, consider making a small donation
to show your support for this Web site and its content.

Written and compiled by Réal Gagnon ©1998-2005
[ home ]