»
 

Go Back   ResellerRatings Store Ratings > ResellerRatings Forums > Tech Support

Reply
 
LinkBack Thread Tools Display Modes
Old 10-01-2003, 09:24 AM   #1 (permalink)
Registered User
 
Join Date: Sep 2002
Location: Fort Wayne, Indiana
Posts: 12
used_submarine is on a distinguished road
Kids Using Unicode in Java question...

Does anyone know how to implement unicode fonts in the
awt frame? I wanted to display some special characters
in a text field, but I can't seem to get the frame to
use the correct font. I know the correct font is
installed on my system because I can preview the symbols
in the Character Map application. When the window is
created it just displays a ? instead of the symbol.
Here's some of the code I'm using.

String test = "\u2665"; // black heart suit symbol

Font font;

Label label;

...

font = new Font("Courier New", Font.PLAIN, 16);

label = new Label(test);

label.setFont(font);

Thanks,

- Mike

used_submarine is offline   Reply With Quote
Old 10-01-2003, 09:52 AM   #2 (permalink)
Registered User
 
Lowrider's Avatar
 
Join Date: Oct 2001
Location: Michigan
Posts: 180
Lowrider is on a distinguished road
Send a message via AIM to Lowrider Send a message via Yahoo to Lowrider
Try putting single quotes around \u2665 and defining it as a char.

Hope this helps.

Chris

Last edited by Lowrider; 10-01-2003 at 09:54 AM.
Lowrider is offline   Reply With Quote
Old 10-01-2003, 04:33 PM   #3 (permalink)
Registered User
 
Join Date: Sep 2002
Location: Fort Wayne, Indiana
Posts: 12
used_submarine is on a distinguished road
Thanks for trying, but it still didn't work. In the frame itself, it is printing out a square, but it prints a question mark in the JBuilder console window when I tested that.

used_submarine is offline   Reply With Quote
Old 10-02-2003, 10:09 PM   #4 (permalink)
Banned
 
Join Date: Sep 2003
Posts: 35
pedantic is on a distinguished road
is "\u2665" even the spade?

what character set are you using, there are many.

font is different, how to display char.

check out:
http://www.unicode.org

I found a spade on:

http://www.unicode.org/charts/PDF/U2600.pdf
pedantic is offline   Reply With Quote
Old 10-04-2003, 07:16 AM   #5 (permalink)
Registered User
 
Join Date: Sep 2002
Location: Fort Wayne, Indiana
Posts: 12
used_submarine is on a distinguished road
Thanks pedantic, but I've already been to Unicode.org. I'm not sure where you're getting all of this talk about "spades", because I was talking about the black hart symbol which is a few boxes down from the spade on Unicode.org.

A friend at school has told me that the Java AWT cannot handle such high level unicode, so I should stick with dollar signs and basic stuff like that. He said it might be possible if I used Swing, but I'm unfamiliar with that. Thanks for trying to help though.

-End of thread-
used_submarine is offline   Reply With Quote
Old 10-04-2003, 09:20 PM   #6 (permalink)
Banned
 
Join Date: Sep 2003
Posts: 35
pedantic is on a distinguished road
Quote:
I'm not sure where you're getting all of this talk about "spades", because I was talking about the black hart symbol which is a few boxes down from the spade on Unicode.org.
lol,lol.

Quote:
is "\u2665" even the spade?
what character set are you using, there are many.
Quote:
was talking about the black hart symbol
what's that? you talking deck o'cards, or charset?

everyone knows hearts are RED!

btw, what color is the"?"?
pedantic is offline   Reply With Quote
Reply




Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Most Active Discussions

Recent Discussions

All times are GMT -6. The time now is 10:14 PM.