UnRAVLFrame.java 文件源码

java
阅读 37 收藏 0 点赞 0 评论 0

项目:unravl 作者:
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);
        }
    }
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号