Java Image Load getImage(String imageName, String path)

Here you can find the source of getImage(String imageName, String path)

Description

get Image

License

Open Source License

Declaration

public static Image getImage(String imageName, String path) 

Method Source Code


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

import java.awt.Image;
import javax.swing.ImageIcon;

public class Main {
    private static final String IMAGE_URL_PREFIX = "images/";

    public static Image getImage(String imageName, String path) {
        return new ImageIcon(getImageURL(imageName, path)).getImage();
    }// w ww.j  a v  a  2 s .  c  o m

    public static String getImageURL(String imageName, String path) {
        return IMAGE_URL_PREFIX + path + "/" + imageName;
    }
}

Related

  1. getImage(String path)
  2. getImage(String path)
  3. getImage(String text, boolean clockwise)
  4. getImage(String url)