@@ -0,0 +1,1512 @@
+package com.oozinoz.imaging;%0A%0Aimport java.awt.*;%0Aimport javax.swing.*;%0A%0Apublic class ImageIconProxy%0A%09extends ImageIcon%0A%09implements Runnable %7B%0A%09static final ImageIcon ABSENT =%0A%09%09new ImageIcon(%0A%09%09%09ClassLoader.getSystemResource(%22absent.jpg%22));%0A%09static final ImageIcon LOADING =%0A%09%09new ImageIcon(%0A%09%09%09ClassLoader.getSystemResource(%22loading.jpg%22));%0A%09ImageIcon current = ABSENT;%0A%09protected String filename;%0A%09protected JFrame callbackFrame;%0A/**%0A * Construct an ImageIconProxy that will (on demand) %0A * load the image in the provided file.%0A *%0A * @param filename the name of a file to load%0A */%0Apublic ImageIconProxy(String filename)%0A%7B%0A%09super(ABSENT.getImage());%0A%09this.filename = filename;%0A%7D%0A/**%0A * Get the height of the Icon%0A */%0Apublic int getIconHeight()%0A%7B%0A%09return current.getIconHeight();%0A%7D%0A/**%0A * Get the width of the Icon%0A */%0Apublic int getIconWidth()%0A%7B%0A%09return current.getIconWidth();%0A%7D%0A/**%0A * Load the desired image and call back the provided frame%0A * when done.%0A *%0A * @param JFrame the frame to repaint when the image is loaded%0A */%0Apublic void load(JFrame callbackFrame)%0A%7B%0A%09this.callbackFrame = callbackFrame;%0A%09current = LOADING;%0A%09callbackFrame.repaint();%0A%09new Thread(this).start();%0A%7D%0A/**%0A * Paint the Icon%0A */%0Apublic synchronized void paintIcon(%0A%09Component c,%0A%09Graphics g,%0A%09int x,%0A%09int y)%0A%7B%0A%09current.paintIcon(c, g, x, y);%0A%7D%0A/**%0A * Load the desired image (presumably in a separate thread). %0A */%0Apublic void run()%0A%7B%0A%09current =%0A%09%09new ImageIcon(%0A%09%09%09ClassLoader.getSystemResource(filename));%0A%09callbackFrame.pack();%0A%7D%0A%7D%0A

Create ImageIconProxy.java