You can call the setIconImage method of the JFrame as follows:

 window.setIconImage(Toolkit.getDefaultToolkit().getImage("image.gif"));