通过AbstractTableModel获取选定的行 [英] getting selected row through AbstractTableModel
本文介绍了通过AbstractTableModel获取选定的行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
是否可以从我的表模型中获取所选行索引?
Is it possible to get the selected row index from my table model?
我的对象已经知道了表模型。我自己可以使用模型获取所选索引而不是传递对表的引用吗?
My object already knows about the table model. Instead of passing a reference to the table it self can i get the selected index using the model?
推荐答案
TableModel只关注自身对于数据,ListSelectionModel关注当前选择的内容,因此,不能从TableModel中获取所选行。
The TableModel only concerns itself with the data, the ListSelectionModel concerns itself with what is currently selected, so, no you can't get the selected row from the TableModel.
这篇关于通过AbstractTableModel获取选定的行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文