我在sf上已经回答你了,升级你的jdk吧
import javax.imageio.ImageIO;
import javax.swing.*;
import java.awt.*;
import java.awt.image.BufferedImage;
import java.io.IOException;
import java.net.URL;
/**
* Created by reeco_000 on 2015/7/11.
*/
public class Image {
public static void main(String[] args) {
BufferedImage image = null;
try {
URL url = new URL("
https://t.williamgates.net/image-3CFE_55A097D8.jpg");
image = ImageIO.read(url);
} catch (IOException e) {
e.printStackTrace();
}
JFrame frame = new JFrame();
JLabel label = new JLabel(new ImageIcon(image));
frame.getContentPane().add(label, BorderLayout.CENTER);
frame.pack();
frame.setVisible(true);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
}
}