Como colocar uma imagem da internet num JLabel?
tenta isso aqui
JLabel componenteSwingComImageIcon =
new JLabel(new ImageIcon("www.seusite.com.br/fotos/suafotojpg"));
Do site da sun, com possibilidade de implementar um progressbar
private Icon getIconFromUrl(String strImageUrl) throws MalformedURLException,IOException{
URL imgUrl = null;
imgUrl = new URL(strImageUrl);
java.io.InputStream is = imgUrl.openStream();
ImageInputStream iis = ImageIO.createImageInputStream(is);
Iterator<ImageReader> it = ImageIO.getImageReadersBySuffix("jpg");
ImageReader reader = it.next();
reader.setInput(iis);
/*
reader.addIIOReadProgressListener(new IIOReadProgressListener() {
public void sequenceStarted(ImageReader source, int minIndex) {
}
public void sequenceComplete(ImageReader source) {
}
public void imageStarted(ImageReader source, int imageIndex) {
}
public void imageProgress(ImageReader source, float percentageDone) {
//setProgress((int) percentageDone);
System.out.print(percentageDone+"\n");
}
public void imageComplete(ImageReader source) {
System.out.print(100+"\n");//setProgress(100);
}
public void thumbnailStarted(ImageReader source, int imageIndex, int thumbnailIndex) {
}
public void thumbnailProgress(ImageReader source, float percentageDone) {
}
public void thumbnailComplete(ImageReader source) {
}
public void readAborted(ImageReader source) {
}
});
*/
Image image = reader.read(0);
Icon icon = new ImageIcon(image);
//System.out.print("End\n");
return icon;
}