import javax.swing.*; import java.awt.event.*; import java.awt.*; public class ImageApplication extends JFrame { public static void main (String argv []) { java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new ImageApplication("Image Application"); } }); } // Declare instance variables: Image bvzImage; // Define constructor public ImageApplication(String title) { super(title); bvzImage = new ImageIcon("/home/bvz/www-home/bvz.gif").getImage(); getContentPane().add("Center", new bvzComponent()); // setDefaultCloseOperation tells Java what to do when the close button // in the main window is pressed setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); setSize(bvzImage.getWidth(null), bvzImage.getHeight(null)); setVisible(true); } class bvzComponent extends JComponent { public void paintComponent(Graphics g) { ((Graphics2D)g).drawImage(bvzImage,0, 0, null); } } }