现象:在panel上添加了事件监听,但在调用panel.nofityLister(PanelEvent.EventType, new Event())触发的时候, handler并没有被调用。
panel.addListener(PanelEvent.EventType, new Listener(){
@Override
public void handleEvent(Event arg0) {
// TODO Auto-generated method stub
}
});原因:用了int 0作为Event的ID。
本文介绍了一种在使用Panel组件并为其添加事件监听时遇到的问题:尽管已经正确地添加了监听器,在尝试触发监听器时却未能成功调用相应的处理方法。通过分析代码示例,发现导致该问题的原因在于使用了不正确的Event ID——int0。
3145

被折叠的 条评论
为什么被折叠?



