Using Unicode in Java question...  | |
October 1st, 2003, 12:24 PM
|
#1 (permalink)
| | Junior Member
Join Date: Sep 2002 Location: Fort Wayne, Indiana
Posts: 20
| 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 |
| |
October 1st, 2003, 12:52 PM
|
#2 (permalink)
| | Member
Join Date: Oct 2001 Location: Michigan
Posts: 180
|
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.
|
| |
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.  |
| |
October 3rd, 2003, 01:09 AM
|
#4 (permalink)
| | Banned
Join Date: Sep 2003
Posts: 35
| |
| |
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- |
| |
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"?"? |
| | | Thread Tools | Search this Thread | | | | |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | | | | Most Active Discussions | | | | | Recent Discussions  | | | | | |