import java.awt.*;
import java.awt.image.*;
import javax.swing.*;
import javax.media.jai.*;
class ImageLabel extends JLabel
{
private BufferedImage bufferedImg = null;
private ImageIcon ico = null;
private Image img = null;
public ImageLabel (String filename) {
setImageFromFile(filename);
}
public void setImageFromFile (String filename) {
RenderedOp src = JAI.create("fileload", filename);
bufferedImg = src.getAsBufferedImage() ;
img = Toolkit.getDefaultToolkit().createImage(bufferedImg.getSource());
ico = new ImageIcon(img);
setIcon(ico);
}
}