The easiest way depends on what you want to do. With what you've given so far, if
DisplayJAI is a JComponent extension then you could drag and scale/zoom the image in this
components
paintComponent method. The basic idea is to creat e Rectangle the size of the
image in the component. Draw the image at the origin of the Rectangle. In you mouse code
you can use the rectangle to
test for
mousePressed events in which you initiate a drag
episode. In the
mouseDragged method you can reposition the rectangle and repaint the
component.
For the scaling you can use an AffineTransform to scale the image, or any designated
(clipped) part of it, and either scale it on the fly with
g2.drawRenderedImage(image,
xform) or make up a new BufferedImage by scaling the original and draw the new image.
I would be wary of using the
Image.getScaledInstance method which can be slow (and
loads asynchronously) compared to scaling a BufferedImage.
Examples of both scaling and dragging images have been posted in this forum.