Display and Input Chinese conflict? +other qs.
I have a Swing Application - and I want to have part of the GUI in Chinese. (List boxes etc.) In order to do this, I use Bitstream Cyberbit font and it works fine.
In order to Input data in Chinese in a TextField, I use NJstar to do the data entry. This works fine on its own as well.
- Now, when I have an application to do BOTH the above, it does'nt work (I cannot input Chinese AND display chinese)
Do I need to use a font or something that comes with NJstar for DISPLAY as well?
Is there an underlying conflict between NJStar and BitStream Cyberbit on when working together - i.e. one cannot use bitstream cyberbit for display and NJstar's font for data entry?
- Data entered by entered by NJStar in chinese can be read by Java as Unicode? For example
//if textfield1 contains chinese characters (as entered by njstar)
String chineseString = jtextfield1.getText();
do I need to do any change in encoding?
- Sometimes NJstar enters rubbish (incorrect encoding) in my Swing window? Anyone had the same problem?
Please advise. TIA,
Carlos
[1132 byte] By [
carlosnf] at [2007-9-26 3:35:57]

Hi Carlos,
I'm yet to meet the Bitstream Cyberbit font, but one question sticks in my head. Is it a Unicode-based font?
AFAIK, NJStar enters all its data in a Unicode format, so it's possible that while Swing knows how to handle NJStar's input, the Bitstream font doesn't know how to display it.
As for the rest, the only other thing I can suggest is that every now and then CJK characters like to be converted over to UTF-16 in Java as opposed to UTF-8. I'm still not entirely sure why. :)
From memory, you can change the encoding of the data you're entering with NJStar, so that might be worth a shot.
Hope that helps!
Martin Hughes
how did you get java to accept input from chinese? Every time I do that, characters don't show up. I am also using njstar and characters show up in notepad. I have tried switching the njstar output encoding to UTF-8, GB2312, and Big5, and it just doesn't work with the 1.4jdk. Do I have to use the internationalized jre? I noticed there are two JRE's US and internationalized, and only one sdk?
I see you have conquered the step I am after, input of chinese.
thanks for any help you can provide.
dean