I found This code to align values in "كوردى" column to Right-To-Left.
It works fine, But when i edit cells the align becomes Left-To-Right as shown at the above Image,
What i do to align values to Right-To-Left while editing ?
Asked
Active
Viewed 658 times
0

Community
- 1
- 1

Hamreen Ahmad
- 522
- 5
- 21
-
changenthe default editor for the column to support your requirements – MadProgrammer Nov 03 '15 at 19:12
-
1I'm wondering if something like [ths](http://stackoverflow.com/questions/354745/java-swing-gui-components-howto-rtl-view) will help, although i thought the locale aet this kind of thing up – MadProgrammer Nov 03 '15 at 19:18
-
i found it thanks look at the answer... – Hamreen Ahmad Nov 03 '15 at 19:22
1 Answers
0
I found the my answer, Thanks for all
JTextField textField = new JTextField();
textField.setBorder(new LineBorder(Color.BLACK));
DefaultCellEditor dce = new DefaultCellEditor( textField );
table.getColumnModel().getColumn(2).setCellEditor(dce);
textField.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT);

Hamreen Ahmad
- 522
- 5
- 21
-
I think you set the component orientation globally using [`Component#applyComponentOrientation`](https://docs.oracle.com/javase/8/docs/api/java/awt/Component.html#applyComponentOrientation-java.awt.ComponentOrientation-) on the top level component – MadProgrammer Nov 03 '15 at 19:27
-