Here you can find the source of readImageToLabel(String netUrl)
public static void readImageToLabel(String netUrl)
//package com.java2s; //License from project: Apache License import java.awt.Image; import java.io.IOException; import java.net.URL; import javax.imageio.ImageIO; import javax.swing.ImageIcon; import javax.swing.JFrame; import javax.swing.JLabel; public class Main { public static void readImageToLabel(String netUrl) { Image image = null;/*from w ww .j av a 2 s . c om*/ try { URL url = new URL(netUrl); image = ImageIO.read(url); } catch (IOException localIOException) { } JFrame frame = new JFrame(); JLabel label = new JLabel(new ImageIcon(image)); frame.getContentPane().add(label, "Center"); frame.pack(); frame.setVisible(true); frame.setDefaultCloseOperation(3); } }