Reprinted from: http: //huangqiqing123.iteye.com/blog/1678208
Since Jlabel default are transparent, so the background color is set directly see the effect by setBackground (color), if you want to see the effect, you must first set the JLabel opaque on it.
- Tips = the JLabel new new the JLabel ( "being executed, please wait ..." );
- tips.setOpaque ( to true ); // opaque JLabel component provided only to opaque, the background color setting valid
- tips.setBackground(ColorUtil.LU_DOU_SHA);