Search code examples
javaswingjtextfield

JTextField to read chinese character


I need to read chinese character through java input fields. I have installed chinese in my system and I have set system locale to chines. I could type chinese character using US key board in notepad. When type in my application I get only the english character. How to make java input fields to read chinese character. Please help me out.


Solution

  • How to make java input fields to read chinese character.

    Perhaps it has something to do with the encoding of your text file. If I have trouble with encodings, I try and create files in either eclipse or OpenOffice, where I am able to specify the encoding. If you are on a mac, you can also use TextEdit, or (even better) Bean.

    edit: I use utf8 encoding.