tryimageiconpic1=新建imageicon(image.class.getresource文件(”/image/1。gif”),然后直接使用jlabeljlabeljlabel1=newjlabel(pic1)。然后尝试imageiconpic1=newimageicon(image.class.getresource文件将句子改为imageiconpic1=newimageicon(“xxxx1。gif”)xxx是gif的路径,请用分隔。例如,在磁盘c的abc目录中,写入imageiconpic1=newimageicon(“c:abc1。gif”)