The Java Developers Almanac 1.4


Order this book from Amazon.

   
Home > List of Packages > javax.swing.table  [62 examples] > Selection  [6 examples]

e944. 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();
    }

 Related Examples
e939. Enabling Row, Column, or Cell Selections in a JTable Component
e940. Enabling Single or Multiple Selections in a JTable Component
e941. Programmatically Making Selections in a JTable Component
e942. Getting the Selected Cells in a JTable Component
e943. Disabling Selections in a JTable Component

See also: Cells    Column Heads    Columns    Editing    Events    Layout    Rows    Scrolling    Sorting    Table Model    Tool Tips   


© 2002 Addison-Wesley.