wood burning stoves*
The moose likes Swing / AWT / SWT and the fly likes Reading chinese characters through java input fields Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Reading chinese characters through java input fields" Watch "Reading chinese characters through java input fields" New topic
Author

Reading chinese characters through java input fields

selva nayagam.K
Greenhorn

Joined: Nov 16, 2009
Posts: 25
HI All

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. Thanks in advance.

Regards.
Selva.
Dan Lingard
Greenhorn

Joined: Aug 12, 2009
Posts: 12
Hi,

I guess your application takes input via JSPs?

1) Are you using Windows? You may find that the input has changed from Chinese to English when you change applications (check the language bar settings).

2) Can you copy and paste the Chinese from notepad into your input field?

3) Do you have the correct page encoding set? You should probably have the charset set to UTF-8 on your JSP page.
selva nayagam.K
Greenhorn

Joined: Nov 16, 2009
Posts: 25
HI Dan,

Thank you for the past reply.

I am working with java swing

My system is Windows XP. Input does not changed English it remains as Chinese (Even I have removed english in control panel and checked)

I can copy and paste chines from notepad to input field

Regards,
Selva.




Dan Lingard
Greenhorn

Joined: Aug 12, 2009
Posts: 12
Hi Selva,

I'm afraid I can't help you, as I don't really use swing in my line of work.

I think you'll have more luck posting in the Swing / AWT / SWT / JFace section of the forums, rather than the JSP section.

Dan
Shashank Ag
Ranch Hand

Joined: Dec 22, 2009
Posts: 88

You probably need to set chinese locale in the very main method from which swing application starts.

SCJP 91%, SCWCD 97%
Liu Xing
Greenhorn

Joined: Jul 19, 2010
Posts: 12
Shashank Ag wrote:You probably need to set chinese locale in the very main method from which swing application starts.

Yes. I think so.
 
jQuery in Action, 2nd edition
 
subject: Reading chinese characters through java input fields