Java ImageIcon Create createImageIcon(String iconFile)

Here you can find the source of createImageIcon(String iconFile)

Description

Returns an ImageIcon, or null if the iconFile is invalid.

License

Open Source License

Declaration

public static ImageIcon createImageIcon(String iconFile) 

Method Source Code

//package com.java2s;

import javax.swing.ImageIcon;

public class Main {
    /** Returns an ImageIcon, or null if the iconFile is invalid. */
    public static ImageIcon createImageIcon(String iconFile) {
        if (iconFile != null) {
            return new ImageIcon(iconFile);
        } else {//from www. ja  v  a2  s  .c o  m
            System.err.println("Couldn't find file: " + iconFile);
            return null;
        }
    }
}

Related

  1. createImageIcon(ClassLoader classloader, String path, String description)
  2. createImageIcon(File f, String description)
  3. createImageIcon(final Icon icon)
  4. createImageIcon(final String src)
  5. createImageIcon(java.net.URL imgURL)
  6. createImageIcon(String imgFile)
  7. createImageIcon(String path)
  8. createImageIcon(String path)
  9. createImageIcon(String path)