java命名空间javax.swing.plaf.basic类basiclistui的类成员方法:
createlistselectionlistener定义及介绍
本文导语:
createlistselectionlistener
protected listselectionlistener createlistselectionlistener()
创建在需要时由 selectionmodel 添加到 jlist 的 listselectionhandler 的实例。子类可以重写此方法以返回自定义 listselectionlistener,例如
class mylistui extends basiclistui {
...
createlistselectionlistener
protected listselectionlistener createlistselectionlistener()
- 创建在需要时由 selectionmodel 添加到 jlist 的 listselectionhandler 的实例。子类可以重写此方法以返回自定义 listselectionlistener,例如
class mylistui extends basiclistui {
protected listselectionlistener createlistselectionlistener() {
return new myselectionlistener();
}
public class myselectionlistener extends listselectionhandler {
public void valuechanged(listselectionevent e) {
// do some extra work when the selection changes
super.valuechange(e);
}
}
}
- 另请参见:
basiclistui.listselectionhandler
,
installui(javax.swing.jcomponent)