Advertisement
Jeyjey0

Java Image From path Loader

Sep 15th, 2017
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. package Graphics;
  2.  
  3. import java.awt.image.BufferedImage;
  4. import java.io.File;
  5. import java.io.IOException;
  6.  
  7. import javax.imageio.ImageIO;
  8.  
  9. public class ImageLoader {
  10.  
  11. public static BufferedImage loadImage(String path){
  12. try {
  13. System.out.println("Loading: "+path);
  14. return ImageIO.read(new File(path));
  15. } catch (IOException e) {
  16. System.out.println(path);
  17. System.out.println("Error by: "+e);
  18.  
  19.  
  20. }
  21. return null;
  22. }
  23.  
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement