开发者社区 问答 正文

Java 如何读取该 SSL 图片?

Java 如何读取该 SSL 图片? 如何实现?请给出例子代码,谢谢!

展开
收起
蛮大人123 2016-02-25 15:34:11 1720 分享 版权
1 条回答
写回答
取消 提交回答
  • 我说我不帅他们就打我,还说我虚伪
    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);
        }
    }
    2019-07-17 18:47:35
    赞同 展开评论
问答分类:
问答地址: