BufferedInputStream in = new BufferedInputStream(con1.getInputStream()); ByteArrayOutputStream byteArrayOut = new ByteArrayOutputStream(); int c; while ((c = in.read()) != -1) { byteArrayOut.write(c); } Image image = Toolkit.getDefaultToolkit().createImage( byteArrayOut.toByteArray()); label.setIcon(new ImageIcon(image));
Read full article from url - Java Load image from URLConnection - Stack Overflow
No comments:
Post a Comment