home hardware prices news articles forums photos user reviews
Go Back   Tech Support Forums - TechIMO.com > PC Hardware and Tech > Webmastering and Programming
Ask a Tech Support Question (free)!

Using Unicode in Java question...

Reply
Get bargains at  »  Dealighted.com
 
Thread Tools Search this Thread
Currently Active Users: 2137
Discussions: 200,947, Posts: 2,379,387, Members: 246,309
Old October 1st, 2003, 12:24 PM   Digg it!   #1 (permalink)
Junior Member
 
Join Date: Sep 2002
Location: Fort Wayne, Indiana
Posts: 20
Question
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 October 1st, 2003, 12:52 PM     #2 (permalink)
Member
 
Lowrider's Avatar
 
Join Date: Oct 2001
Location: Michigan
Posts: 180
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 : October 1st, 2003 at 12:54 PM.
Lowrider is offline   Reply With Quote
Old October 1st, 2003, 07:33 PM     #3 (permalink)
Junior Member
 
Join Date: Sep 2002
Location: Fort Wayne, Indiana
Posts: 20
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 October 3rd, 2003, 01:09 AM     #4 (permalink)
Banned
 
Join Date: Sep 2003
Posts: 35
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 October 4th, 2003, 10:16 AM     #5 (permalink)
Junior Member
 
Join Date: Sep 2002
Location: Fort Wayne, Indiana
Posts: 20
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 October 5th, 2003, 12:20 AM     #6 (permalink)
Banned
 
Join Date: Sep 2003
Posts: 35
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
Thread Tools Search this Thread
Search this Thread:

Advanced Search


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Most Active Discussions
Making Health Care Worse (170)
The disrespect of Obama by Russian .. (22)
Is It Just Me? (2934)
Wireless Televisions. (11)
windows 7 problem (7)
CPU fan stops spinning randomly (8)
Regular Build (6)
Is the PSU I received dead? (12)
radeon x850xt platinum & shader.. (5)
Print spooler problem (15)
HIS HD5770 graphic card question (15)
windows vista security holes (9)
Install XP pro and a Vista laptop ?.. (11)
Dept. of HS: NSA 'Helped' Develop V.. (15)
Recent Discussions
Internet Lost (1)
Hp Artist Edition + Matching Bag (0)
My monitor won't turn on after instal.. (0)
Graphics Card Upgrade Question (2)
Asus P4G8X Mobo (6)
radeon x850xt platinum & shader 3 (5)
Xbox 360 GTA: SA disk error (1)
Is the PSU I received dead? (12)
How to convert MP3's (2)
windows 7 internet problem (5)
Multiple Restarts Required at Boot (0)
BSOD On Startup (ntoskrnl.exe) (2)
Print spooler problem (15)
Laptop with wireless problem. (1)
Wireless Televisions. (11)
Have you switched yet? (86)
screen resolution vs monitor size (2)
sms storage to PC (0)
Regular Build (6)
Open With ..... Win7 (0)
java code for fibonacci (1)
[F@H SPAM 11/16/09] ! 1/2 months to r.. (35)
windows 7 problem (7)
CPU fan stops spinning randomly (8)
Partition Magic caused HDD problem (3)


All times are GMT -4. The time now is 08:28 PM.
TechIMO Copyright 2009 All Enthusiast, Inc.



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28