JTable获取选中行
bookTable.addMouseListener(new MouseListener() { @Override public void mouseClicked(MouseEvent mouseEvent) { flag = bookTable.getSelectedRow();/*判断哪一行被选中了,如果没有选中,返回值为-1*/ //此行数即为二维数组的行