Getting the Anchor Cell in a JTable Component

The anchor cell in a table component is the cell that received the most recent mouse click. In some applications, the content of the anchor cell is automatically displayed in another larger and more convenient editing text area.
public void getAnchorCell(JTable table) { int rowIndex = table.getSelectionModel().getAnchorSelectionIndex(); int vColIndex = table.getColumnModel().getSelectionModel() .getAnchorSelectionIndex(); }

Post a comment

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
Image CAPTCHA
Enter the characters shown in the image. Ignore spaces and be careful about upper and lower case.