摘要: 在父元素中绑定MouseMotion监听,但是当鼠标在子元素中时父元素无法收到这时候需要在子元素中绑定MouseMotion,然后使用: getParent().dispatchEvent(e);但是,这时候父元素收到当坐标是不对当,所以在父元素中需要使用SwingUtilities转换一下坐标系统:if(e.getSource() != parent) { e = SwingUtilities.convertMouseEvent((child) e.getSource(), e,parent);} 阅读全文
posted @ 2013-12-20 11:08 wangchao719 阅读(416) 评论(0) 推荐(0) 编辑