public void addZoomMouseListeners() {
MouseWheelListener zoomer = new java.awt.event.MouseWheelListener() {
public void mouseWheelMoved(java.awt.event.MouseWheelEvent evt) {
onZoom(evt);
}
};
for (JTextArea ta : textAreas) {
// Note: We cannot add a MouseWheelListener to the JTextArea; the
// JScrollPane
// will disable it's scrolling handler of the child has a mouse
// listener.
// So walk from the JtextArea to JViewPort to JScrollPane and add
// the listeners there.
if (ta.getParent().getParent() instanceof JScrollPane) {
JScrollPane parent = (JScrollPane) ta.getParent().getParent();
parent.addMouseWheelListener(zoomer);
}
}
}
UnRAVLFrame.java 文件源码
java
阅读 37
收藏 0
点赞 0
评论 0
项目:unravl
作者:
评论列表
文章目录