When user inserted mixed English/Hebrew or mixed English/Arabic text into JText field, I want to build letter by letter a new String str, in which characters will be exactly in the same order (str[0], str[1],...) that they are visible in the JTextField from left to right or from left to right. That's all I want, because then I need this String to build a RTF document, and otherwise a mixed text makes a lot of problems. May be I should use a caret?
Thanks Frederic!
If I use Listener, I'll get charecters in the order they are printed, and I need to get them in the order they are visible. When you enter the mixed text, part of which is Hebrew/Arabic(from right to left) and part of which is English, you get a big mess in the JText Field.
Maybe I should use BasicTextUI.getNextVisualPositionFrom function? But I don't understand exactly what it does and how it works.
Regards,
Nemaria.