0

I have the following table enter image description here

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 ?

Community
  • 1
  • 1
Hamreen Ahmad
  • 522
  • 5
  • 21

1 Answers1

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
  • but i have some TextFields in my project that are Left-to-Roght – Hamreen Ahmad Nov 03 '15 at 19:29