[英]Align values in JTable cells to right-to-left while Editing
I have the following table 我有下表
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 ? 我在编辑时如何将值从右向左对齐?
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);
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.