> I have a JTable instance with two columns and certain number of
> rows. The first column (on the left) lists the property name and right
> column lists the value of the corresponding property. The property
> values are editable (by the user) whereas the property names are not.
> The default tab order takes a right/down approach. However I wish that
> as the tab is pressed, only the editable fields (i.e. the right column
> stack) get focus.
> To be clear, I want the tab order to be
> cell(0,1) -> cell(1,1) -> cell (2,1) ... cell(0,1) ... where
> cell(ROW,COL) is the cell at the intersection of row ROW and col COL.
> Do you know how is this possible. I know that the tab order can
> be set for different components, but I dont know how to do it within a
> JTable. Can you please help me out.
> Thanks in advance,
You can write your own Action classes that performs the appropriate cell
navigation and link those Actions to the keys "selectNextColumnCell" and
"selectPreviousColumnCell" in the ActionMap of the table. (These are the
strings that map to Tab and Shift-Tab keys respectively in the default
InputMap of a JTable).
If you do not want to rely on this implementation detail, you can modify
the InputMap of the JTable to map the Tab / Shift-Tab keystrokes to some
other string values, and map those strings to your custom actions in the