Image image = Toolkit.getDefaultToolkit().getImage(
ImageDisplayer.imageFile);
ImagePanel imagePanel = new ImagePanel(image);
JFrame f = new JFrame("ImageDisplayer");
f.addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent e) {
System.exit(0);
}
});
f.getContentPane().add(imagePanel, BorderLayout.CENTER);
f.setSize(new Dimension(550,100));
f.setVisible(true);