color-code string messages?

M

Myriam Abramson

Hi!

Can you specify the color in which to display a string in the unicode
format? Could you give me an example on how to do that in Java?
I know you can do that in Swing but I'm just passing a string message
to another program for display purposes.

TIA

myriam
 
J

Joona I Palaste

Myriam Abramson said:
Can you specify the color in which to display a string in the unicode
format? Could you give me an example on how to do that in Java?
I know you can do that in Swing but I'm just passing a string message
to another program for display purposes.

No, you can't. Unicode, by itself, does not support the concept of
colours at all. Either define some fancy character sequences to mean
the colour or pass the colour around separately.

--
/-- Joona Palaste ([email protected]) ---------------------------\
| Kingpriest of "The Flying Lemon Tree" G++ FR FW+ M- #108 D+ ADA N+++|
| http://www.helsinki.fi/~palaste W++ B OP+ |
\----------------------------------------- Finland rules! ------------/
"A bee could, in effect, gather its junk. Llamas (no poor quadripeds) tune
and vow excitedly zooming."
- JIPsoft
 
R

Roedy Green

Can you specify the color in which to display a string in the unicode
format?

Unicode has no official way to code colours.

HTML does. You can embed HTML commands to control colours. Java has
ways of rendering simple HTML. see
http://mindprod.com/jgloss/html.html

RTF does.

If all you want to do is make a field show up in a different colour,
you have setForeground and setBackground.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top