When I add columns to JTable, By default, they’re arranged from left to right.
e.g. if I add in this order (Left to right):
col1,col2,col3
I will get:
+------+------+------+
| col1 | Col2 | Col3 |
+------+------+------+
But I want this:
+------+------+------+
| col3 | Col2 | Col1 |
+------+------+------+
How can I make a JTable that arrange columns from right to left?
setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT) or applyComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT) will do the trick.
Please refer to java doc for further clarifications
setComponentOrientation
applyComponentOrientation