frame.setIconImage(img);

Read more of this post