title: Zoom in and out of images in Java
body: <p>I think the question is quite self-explanatory. I want to implement a simple zoom function using a <code>JSlider</code> like in Windows Live Photo Gallery for instance.</p>
  
  <p>I've had a quick look online but all the code I've tried to use appears to have errors when I copy it into Eclipse. I don't really want to use a third-party library either as the application may be sold under a company name. Plus, I'm beginning to realise that there may be some safety precautions required in order to prevent errors, but I do not know what these will be.</p>
  
  <p>So, if anybody can provide me with some Java code to zoom in and out of images it would be greatly appreciated.</p>
  
  <p>P.S. I plan to use the Image as an <code>ImageIcon</code> inside of a <code>JLabel</code> which will be added to a <code>JScrollPane</code>.</p>