This week's book giveaway is in the JavaScript forum.
We're giving away four copies of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js and have Paul Jensen on-line!
See this thread for details.
Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Displaying foreign characters  RSS feed

 
Pradeep Kumar T
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I have a situation where I need to be able to display foreign characters (asian languages) in a text area in my program.
I have no idea on how to do this.

http://www.code2000.net/keybkann.htm

I need to produce something like this, using java Swing...

Can anyone please advice?
thanks a lot in advance!
 
Kaydell Leavitt
Ranch Hand
Posts: 690
Eclipse IDE Firefox Browser Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think that what you want is a JTextField object. (You may also want to consider using the JTextArea and the JTextPane classes.

If you want to filter input as it is entered, I think you'd want to use a DocumentFilter object. If you want to validate input after it is finished, I think that you'd want to use an InputVerifier object. There is a class that helps you to ensure that text is in a particular format (but I don't recall what this class is called.)

The Java types: char, String, StringBuffer, & StringBuilder all use a fixed-length 16-bit Unicode. If you need to use Asian characters outside of the original 16-bit limit, you'll have to do things differently.

For example, instead of using a char to hold chars, you'd have to use an int since it will hold all Unicode values, even those that exceed the 16-bit limit.

Kaydell
[ May 18, 2007: Message edited by: Kaydell Leavitt ]
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!