We help IT Professionals succeed at work.

Language Setting in Swing not working now

zolf
zolf asked
on
Medium Priority
266 Views
Last Modified: 2010-03-31
hello there,

I have a JInternalFrame form which opens in a JDesktopPane.in the form i have JTextField which takes name in english and persian.first is the english name testfield which is straight forward to type in.the second textfield takes the persian name.which when gets the focus i change the Locale to Locale l = new Locale("fa","IR"); using focusListener.it works fine to some extend.i mean i can type from right to left in the second TF,but does not recognize persian fonts,it only recognizes arabic fonts.
in my previous question i asked at EE called Title: Keyboard Language Setting in Swing Applications. i was able to acheive this persian thingy.but now when i have made a little more complex UI.it does not work.please help me to acheive my goals.

cheers
zolf
Comment
Watch Question

Mick BarryJava Developer
CERTIFIED EXPERT
Top Expert 2010

Commented:
not sure if swing supports mixed input methods, are you calling selectInputMethod() in your focuslistener?

Author

Commented:

the problem was with the font.persian is only supported with some fonts.i changed the font to arial ad it worked.
i have one another question.can you refer me to some good site where i can insert data to a oracle 10g database from java.

cheers
zolf
Mayank SPrincipal Technologist
CERTIFIED EXPERT
Commented:
You have plenty of samples here, you can use most of them for Oracle - just make sure you give the correct driver-name:

http://www.javaalmanac.com/egs/java.sql/pkg.html

Download the driver from http://www.oracle.com/technology/software/tech/java/sqlj_jdbc/

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts
Java Developer
CERTIFIED EXPERT
Top Expert 2010
Commented:
> the problem was with the font.persian is only supported with some fonts.i changed the font to arial ad it worked.

perhaps also change the font in your focus listener
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.