Java JFrame Icon SET_FRAME_ICON(JFrame f, String iconPath)

Here you can find the source of SET_FRAME_ICON(JFrame f, String iconPath)

Description

SEFRAMICON

License

Open Source License

Declaration

public static void SET_FRAME_ICON(JFrame f, String iconPath) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import javax.swing.ImageIcon;

import javax.swing.JFrame;

public class Main {
    public static void SET_FRAME_ICON(JFrame f, String iconPath) {
        f.setIconImage(new ImageIcon(f.getClass().getResource(iconPath)).getImage());
    }/*from  w w  w.  j av a  2 s  .c o  m*/
}

Related

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