import java.awt.image.BufferedImage;
import java.io.*;
import java.net.URL;
import javax.imageio.ImageIO;
import javax.swing.*;
public class DownloadImage {
public static void main(String[] args) throws IOException {
String path = "http://www.java-forums.org/images/ca_evo/misc/logo.gif";
URL url = new URL(path);
InputStream stream = url.openConnection().getInputStream();
BufferedImage image = ImageIO.read(stream);
JFrame f = new JFrame();
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
f.add(new JLabel(new ImageIcon(image), JLabel.CENTER));
f.pack();
f.setLocationRelativeTo(null);
f.setVisible(true);
}
}