Title: RE: set color of JLabel text
on, this subject...
there's something that I've wanted to do for a long time.
multi-colored textfields.
I'm talking like have 4 letters in red, then 4 in blue, then 4 in red, then 4 in blue.
not that I want to have that to do a word break down of some hex values...
but I do.
Any clues how to do this?
rev aaron
-----Original Message-----
From: Greg Munt [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, April 03, 2001 8:06 AM
To: Pepelis, Aaron; [EMAIL PROTECTED]
Subject: Re: set color of JLabel text

Yes, that will do it.
 
But, if you want this to affect all JLabel components, you need to change the UI default value for Label.foreground. To change it to red:
 
javax.swing.UIManager.put ("Label.foreground", Color.red);
 
Alternatively you can set this via a custom LookAndFeel class, which is what I do.
-----Original Message-----
From: Pepelis, Aaron <[EMAIL PROTECTED]>
To: '[EMAIL PROTECTED]' <[EMAIL PROTECTED]>
Date: Tuesday, April 03, 2001 12:35
Subject: RE: set color of JLabel text

am I missing something?
maybe I just got done doing a radio show at 2:30am and I'm back at work at 7:30am,
but:
JLabel label = new JLabel("hello glory");
label.setForeground(Color.red);

that?
rev aaron

-----Original Message-----
From: Dmitry Beransky [mailto:[EMAIL PROTECTED]]
Sent: Monday, April 02, 2001 12:30 PM
To: '[EMAIL PROTECTED]'
Subject: Re: set color of JLabel text


A good place to start would be
<http://java.sun.com/docs/books/tutorial/uiswing/start/index.html>.  If
you need a Visualage specific answer, I recommend posting to
<http://groups.yahoo.com/group/wsvaj>.

On Mon, 2 Apr 2001, Mario Fernandes (IT Dept. - Langley) wrote:

> Hi
>
> how do I set the color of the text appearing in a JLabel. I am using Ibm
> Visualage and the color of the text appearing  in the JLabel and the JButon
> are different.
>
>
> Thanx in advance
>
>
> Mario
>

_______________________________________________
Swing mailing list
[EMAIL PROTECTED]
http://eos.dk/mailman/listinfo/swing

Reply via email to