On my applet, I have a 200*200 canvas (say CanvasA), and a scrollPane contains another 2000*2000 canvas (say CanvasB) on it. Now I want to two direction communication like this:
1. when I click on CanvasA's position (x, y), I want the scrollPane's scroll position to be adjusted to (10*x, 10*y).
I can implement this by put the scrollPane in CanvasA's constructor;
2. however, when I drag or click on scrollPane's scroll bar, I can get a scroll position (x, y) form scrollPane, I also want a rectangle defined by (x/10, y/10, 30, 30) reflected on CanvasA.
also, here applet, CanvasA, CanvasB are three different class, while scrollPane is just a component on applet.
Hope I have made myself clear.
Looking for your answer, thanks,