Right to left text area

D

Dimi Shahbaz

Hi,

I have been trying to get right to left text working for a while now.
What I want is a JTextArea, with my own very specific font (for a
middle-eastern language that is RTL). I have the TTF font, and I can
get the JTextArea to type with this font. I have even devised a way to
map key strokes on the keyboard to the glyphs from the font that I want.

What I cannot figure out is how to make this text start and flow from
the right to the left. I have tried all variations of
setComponentOrientation() and setAlignmentX(). I have even tried
creating my own DefaultKeyTypedAction() that inserts the glyph I need
and manually moves the cursor left, which I should not (theoretically)
have to do.

I do not need BIDI in the text area, just RTL text, that wraps words at
the left edge of the area. Can't find the right way to do this
anywhere.

Any ideas?

TIA,
Dimi
 
T

toxa26

Try providing your own listener implementation and make delete all
text, append the new char to the left side of the string that was there
and insert it back into your text area.

Hope this helps,
Anton
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top