Java BufferedImage Load loadImage(String path)

Here you can find the source of loadImage(String path)

Description

load Image

License

Open Source License

Declaration

public static Image loadImage(String path) 

Method Source Code


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

import java.awt.Image;
import java.awt.Toolkit;
import java.net.URL;

public class Main {
    public static Image loadImage(String path) {
        URL imgUrl = ClassLoader.getSystemResource(path);
        Image img = Toolkit.getDefaultToolkit().getImage(imgUrl);
        return img;
    }/*w w w.ja va 2s  .  com*/
}

Related

  1. loadImage(String i, int x, int imageWidth, int imageHeight)
  2. loadImage(String image)
  3. loadImage(String imageName)
  4. loadImage(String imageName, Component c)
  5. loadImage(String path)
  6. loadImage(String resourceName)
  7. loadImage(String url)
  8. loadImage(URL resource)
  9. loadImage(URL url)