JTable table = new JTable();
table.getRowCount();
table.getColumnCount()
这样可以取得一个table的所有行和列。
table.getSelectedColumn();
table.getSelectedRow();
可以得到你选中的单无格。
table.getSelectedColumns();
table.getSelectedRows();
可以取得你复数选择的行和列。
找API看一下,都 能找得到。
除非你提前建立映射关系,否则不可能直接得到,只能通过遍历所有单元格吧。
API中没有这样的方法直接调用,需要自己根据相关方法编写。
jtablerow 这个对对象
查JTable的API一个个试