请问怎样把BufferedImage里面的东西转成Image输出!显示到Window里面!谢谢。

解决方案 »

  1.   

    ImageIcon icon = new ImageIcon(bufferedImage);
    JLabel label = new JLabel(icon);
    window.getContentPane().setLayout(new BorderLayout());
    window.getContentPane().add(label, BorderLayout.CENTER);
    window.pack();
    window.setVisible(true);
      

  2.   

    ImageIcon icon = new ImageIcon(bufferedImage);
    JLabel label = new JLabel(icon);
    window.getContentPane().setLayout(new BorderLayout());
    window.getContentPane().add(label, BorderLayout.CENTER);
    window.pack();
    window.setVisible(true);为什么不能显示图片??????