In addition to my Java image FAQ and list of Java libraries to read and write image files this page shows small working Java programs that demonstrate how to deal with image files with the standard runtime library and the most popular external libraries.
java.awt.Toolkit is used to load an image,
MediaTracker makes sure that the image is loaded completely and finally
the image is inserted into a Frame and displayed.
So this 40-line-program is basically a minimum image viewer.
java.awt.Toolkit is used to load an image,
BufferedImage.drawImage does the scaling and
the package com.sun.image.codec.jpeg saves the
thumbnail image as a JPEG file (Java 1.2 or higher required, Sun JDK / JRE recommended).