I'm working currently on java project that uses Arabic Language, I found difficulty in writing in Arabic as shown in the image:
- I wrote Arabic without any edit.
I added a
reverse()
method, it worked good but the letters aren't attached to each other, they're separate.StringBuilder input = new StringBuilder(); input.append(jTextField2.getText()); input = input.reverse(); jTextField1.setText(input.toString());
I use site the flip the text, it didn't work as well.
- I use the same site, but with
jLabel
it worked.
other method I use, but didn't work:
Try Orientation
jTextField1.applyComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT);
Change the IDE encoding to URT-8 (I'm using Netbeans-JDK8).
Can anyone help me how to write & print Arabic in java correctly?