Coordinate conversions will be
necessary when using the row based
methods of JTable with the underlying
TableModel. All of JTables row based
methods are in terms of the RowSorter,
which is not necessarily the same as
that of the underlying TableModel. For
example, the selection is always in
terms of JTable so that when using
RowSorter you will need to convert
using convertRowIndexToView or
convertRowIndexToModel.
# 1 楼答案
如果您使用的是1.6中的内置TableRowSorter功能,则可以在表上使用convertRowIndexToModel()。这将为您提供所选行的未筛选索引
javadoc for JTable对此进行了描述: