Here you can find the source of setApplicationIcon(JFrame frame)
public static void setApplicationIcon(JFrame frame)
//package com.java2s; /*/* w ww . j a va 2 s . c o m*/ * MiscUtil.java * miscellaneous utilities * Copyright (C) 2006 by Institute for Systems Biology, * Seattle, Washington, USA. All rights reserved. * * This source code is distributed under the GNU Lesser * General Public License, the text of which is available at: * http://www.gnu.org/copyleft/lesser.html */ import java.net.URL; import java.net.MalformedURLException; import java.awt.Toolkit; import javax.swing.JFrame; public class Main { public static void setApplicationIcon(JFrame frame) { try { frame.setIconImage(Toolkit.getDefaultToolkit() .getImage(new URL("http://gaggle.systemsbiology.net/images/icons/gaggle_icon_32x32.gif"))); } catch (MalformedURLException ignore) { ignore.printStackTrace(); } } }