Java JFrame Icon setApplicationIcon(JFrame frame)

Here you can find the source of setApplicationIcon(JFrame frame)

Description

set Application Icon

License

Open Source License

Declaration

public static void setApplicationIcon(JFrame frame) 

Method Source Code

//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();
        }
    }
}

Related

  1. getResourceIcon(JFrame fr, String name, Class callingClass)
  2. loadIMageIconToPanel(JFrame frame, JPanel panel, ImageIcon icon)
  3. SET_FRAME_ICON(JFrame f, String iconPath)
  4. setDefaultIcon(final JFrame window, final String imagepath)
  5. setIcon(javax.swing.JFrame jFrame, String icon)
  6. setIconImage(JFrame frame, Class clazz, String path)
  7. setIconImageFromResource(JFrame frame, String resource)