AllExperts > Experts 
Search      

Java

Volunteer
Answers to thousands of questions
 Home · More Questions · Answer Library  · Encyclopedia ·
More Java Answers
Question Library

Ask a question about Java
Volunteer
Experts of the Month
Expert Login

Awards

About Us
Tell friends
Link to Us
Disclaimer

 
 
 
 
About Artemus Harper
Expertise
I have a BS in computer science and am working towards a Masters degree.

Experience
I have experience in Core Java, good background in Java swing/gui, some experience with JNI, Java reflection, and Java java.nio.* knowledge of Java bytecode and annotations. Basics in c++ and c#
 
   

You are here:  Experts > Computing/Technology > Focus on Java > Java > unicode

Topic: Java



Expert: Artemus Harper
Date: 6/22/2008
Subject: unicode

Question
Hello,
i would like to display an Arabic (Unicode) String of characters (enter by user in Jtextarea) from left to right.
NB: I use java netbeans as IDE.
Thank you so match.  

Answer
In the pre init code of the component you can set the orientation to left to right overriding the language default (right to left for Arabic)

In the post-init code for the text area add:
setComponentOrientation(ComponentOrientation.LEFT_TO_RIGHT);

also make sure that java.awt.ComponentOrientation is added as an import in the code.

This is all you should need to do as long as a font with Arabic is available... you might want to make sure the font is set to one that has Arabic symbols. This should not be a problem on an Arabic OS. If this is not the case you might want to include a font with your application.

Add to this Answer    Ask a Question



  Rate this Answer
   Was this answer helpful?
Not at allDefinitely              
   12345  

     
About Us | Advertise on This Site | User Agreement | Privacy Policy | Help
Copyright  © 2008 About, Inc. About and About.com are registered trademarks of About, Inc. The About logo is a trademark of About, Inc. All rights reserved.