// create smaller image and force its loading
Image smallerImage = inImage.getScaledInstance(inWidth, inHeight, Image.SCALE_SMOOTH);
Image tempImage = new ImageIcon(smallerImage).getImage();
// create smaller image and force its loading
Image smallerImage = inImage.getScaledInstance(inWidth, inHeight, Image.SCALE_SMOOTH);
Image tempImage = new ImageIcon(smallerImage).getImage();