Language Setting in Swing not working now

Posted on 2006-04-05
Last Modified: 2010-03-31
hello there,

I have a JInternalFrame form which opens in a 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 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 does not work.please help me to acheive my goals.

Question by:zolf
    LVL 92

    Expert Comment

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

    Author Comment


    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.

    LVL 30

    Assisted Solution

    You have plenty of samples here, you can use most of them for Oracle - just make sure you give the correct driver-name:

    Download the driver from
    LVL 92

    Accepted Solution

    > 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

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Suggested Solutions

    Title # Comments Views Activity
    allStar challenge 1 27
    Which is the latest version of Apache Tomcatl 3 20
    HashMap Vs TreeMap 12 32
    @SBGen Method 3 16
    For customizing the look of your lightweight component and making it look opaque like it was made of plastic.  This tip assumes your component to be of rectangular shape and completely opaque.   (CODE)
    This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
    Viewers learn about the “while” loop and how to utilize it correctly in Java. Additionally, viewers begin exploring how to include conditional statements within a while loop and avoid an endless loop. Define While Loop: Basic Example: Explanatio…
    This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.

    760 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    9 Experts available now in Live!

    Get 1:1 Help Now