Right to left text area

Discussion in 'Java' started by Dimi Shahbaz, Feb 8, 2005.

  1. Dimi Shahbaz

    Dimi Shahbaz Guest

    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
    Dimi Shahbaz, Feb 8, 2005
    #1
    1. Advertising

  2. Dimi Shahbaz

    Guest

    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
    , Feb 9, 2005
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. ROBT NISHIDA

    input text that goes right to left

    ROBT NISHIDA, Oct 29, 2004, in forum: Java
    Replies:
    1
    Views:
    1,042
    VisionSet
    Oct 29, 2004
  2. Replies:
    5
    Views:
    1,104
    Ian Rastall
    Jun 29, 2005
  3. =?Utf-8?B?QmlzaG95?=
    Replies:
    0
    Views:
    969
    =?Utf-8?B?QmlzaG95?=
    Dec 28, 2006
  4. Oran
    Replies:
    2
    Views:
    521
  5. mariomueller
    Replies:
    2
    Views:
    547
    mariomueller
    Aug 24, 2006
Loading...

Share This Page