Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Text and background color for label

843804Oct 18 2004 — edited Oct 18 2004
Hi,
One of the JRE versions (1.3.1_09) sets the color of the text in some of my applet components to an ugly purple. So I would like to specify a more readable color. Can you tell me how to set the text color and the background color for a label, for example? Below is a little example of one of my labels.

Thanks for your help.

    JLabel label = new JLabel(text);
    Font font = new Font("Arial",Font.PLAIN,12);
    label.setFont(font);
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 15 2004
Added on Oct 18 2004
1 comment
215 views