日期:2014-05-20 浏览次数:20784 次
table.getSelectionModel().addListSelectionListener(new ListSelectionListener() { @Override public void valueChanged(ListSelectionEvent event) { if (!event.getValueIsAdjusting()) { TableModel model = table.getModel(); int row = table.getSelectedRow(); int column = table.getSelectedColumn(); System.out.println(model.getValueAt(row, column)); } } });