0
我有一个可排序的ListSelectionListener默认表模型,它侦听双击并打开特定列的详细信息视图。这工作得很好,但是,当我对列进行排序时,监听器不再起作用。排序表打破了TableRowListener?
JTable foosTable = new JTable(model);
TableRowSorter<TableModel> fooSorter = new TableRowSorter<TableModel>(model);
foosTable.setRowSorter(fooSorter);
ListSelectionModel listMod = foosTable.getSelectionModel();
listMod.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
ListSelectionListener barListener = new ListSelectionListener(foosTable);
listMod.addListSelectionListener(barListener);
请问您能显示一些代码吗?谢谢。 – 2010-11-30 19:27:01
我从来没有听说过TableRowListener。 – camickr 2010-11-30 19:30:54