摘自 java tutorial:Many list selection events can be generated from a single user action such as a mouse click. The getValueIsAdjusting method returns true if the user is still manipulating the selection. This particular program is interested only in the final result of the user's action, so the valueChanged method updates the image only if getValueIsAdjusting returns false. 解决办法: public void valueChanged(ListSelectionEvent e) { if (e.getValueIsAdjusting()) return; ...... ...... ...... }
ListSelectionListener 在选择和取消选择时都会激发
public void valueChanged(ListSelectionEvent e) {
if (e.getValueIsAdjusting())
return;
......
......
......
}
2.gflei([email protected])说得有道理
3.怎么会遇到一点挫折就轻言放弃?
4.这么长的代码别人也要调好一阵!