Java Swing Icon createIcon(URL resource)

Here you can find the source of createIcon(URL resource)

Description

This method creates and returns an icon.

License

Apache License

Parameter

Parameter Description
resource The location of the icon.

Return

An icon.

Declaration

public static ImageIcon createIcon(URL resource) 

Method Source Code


//package com.java2s;
//License from project: Apache License 

import java.net.URL;
import javax.swing.ImageIcon;

public class Main {
    /**/* ww w.jav  a 2  s.co  m*/
     * This method creates and returns an icon.
     *
     * @param resource The location of the icon.
     *
     * @return An icon.
     */
    public static ImageIcon createIcon(URL resource) {
        return new ImageIcon(resource);
    }
}

Related

  1. createColourIcon(int colour)
  2. createGrayIcon(Icon icon)
  3. createGrayIcon(Icon icon)
  4. createIcon(java.awt.Component component)
  5. createIcon(String resource)
  6. createIconFromResource(ClassLoader loader, String resourceName)
  7. createIconFromStream(InputStream input)
  8. createTransparentIcon()
  9. createTransparentIcon(final int width, final int height)