在JTable中移动列时是否有事件调用? [英] Is there an event called when a column is moved in a JTable?
本文介绍了在JTable中移动列时是否有事件调用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个 JTable
,具有多个列和行。一旦用户移动了列,我想通过某种事件被通知,以便我可以做一些计算。然而,由于我需要做的只是
I have a JTable
with several columns and rows. Once the user has moved the column, I would like to be informed via an event of some sort, so that I can do some calculations. However, since all I needed to do was
table.getTableHeader().setReorderingAllowed(true);
为了使列可移动,我有些不确定我可以用什么来找出它们已被移动。
to get the columns to be movable, I am somewhat unsure what I can use to find out once they have been moved.
任何建议?
-F
推荐答案
回答我自己的问题..
To answer my own question..
您需要实现 TableModelListener
和 tableChanged
方法为了做到这一点。
You need to implementTableModelListener
, and the tableChanged
method in order to do this.
这篇关于在JTable中移动列时是否有事件调用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文