JTable.getSelectedRows()和JTable.getSelectedColumns()
都分别返回一个整型数组,数组中存放了,选中的行或列的序号

解决方案 »

  1.   

    use Java or Javascript?if you use Internet Explorer and Javascript, try this (see the status bar for row/column numbers):<script language="javascript" >
    function document.onmousemove()
    {
    if (event.srcElement.tagName == "TD")
    {
    window.status = "row:" + event.srcElement.parentElement.rowIndex + ";col:" + event.srcElement.cellIndex;
    }
    else
    window.status = "Move the mouse cursor back to the table to see the row/column numbers";
    }
    </script>
    <table border="1" cellspacing="0" cellspacing="0">
    <tr><td>0-0</td><td>0-1</td><td>0-2</td></tr>
    <tr><td>1-0</td><td>1-1</td><td>1-2</td></tr>
    <tr><td>2-0</td><td>2-1</td><td>2-2</td></tr>
    <tr><td>3-0</td><td>3-1</td><td>3-2</td></tr>
    </table>