Frame has a method:
 void setIconImage(Image image)  
Sets the image to displayed in the minimized icon for this frame.

解决方案 »

  1.   

    可是我用setIconImage(new Image("hello.ico"))不行啊?
      

  2.   

    myFrame.setIconImage(logo);将logo改为你想用的图标就行了。 setIconImage(Toolkit.getDefaultToolkit().createImage(Frame1.class.getResource("logo.gif")));这个方法对要显示的图像有要求。比特深度要为8,比如你打开一个为3的gif文件,不能显示,程序停下来也不报错。用画笔重新保存一下它,文件属性中摘要一页中可以发现此时比特深度变为8,可以正常显示了。
      

  3.   

    目前java直接支持的图像格式好像只有jpg和gif,其它的不行。
      

  4.   

    使用windows的"更改图标"功能,哈哈,给分!