// IN SETUP(), WE ADD ONE LINE OF CODE TO MAKE OUR LISTENER LISTEN TO OUR CURRENT WINDOW this.addMouseWheelListener(new CMouseWheelEvent()); float wheelScalingFactor=1.1; //magnification factor class CMouseWheelEvent implements MouseWheelListener { public CMouseWheelEvent() {} public void mouseWheelMoved(MouseWheelEvent e) { int notches = e.getWheelRotation(); C0.pose(); float r=0.5*width/Rbox; float y=-(10.*notches)/r; C0.anchor(); C0.D=C0.sD+y; C0.pullE(); C1.track(C0); C2.track(C1); C2.apply(); } }