Advertisement
sergAccount

Untitled

Oct 18th, 2020
1,864
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.58 KB | None | 0 0
  1. /*
  2.  * To change this license header, choose License Headers in Project Properties.
  3.  * To change this template file, choose Tools | Templates
  4.  * and open the template in the editor.
  5.  */
  6. package game;
  7.  
  8. import java.awt.Image;
  9. import java.io.File;
  10. import java.io.IOException;
  11. import javax.imageio.ImageIO;
  12.  
  13. public class ImageUtil {
  14.        
  15.     public static Image loadImage(String fileName){
  16.         try{
  17.             return ImageIO.read(new File(fileName));
  18.         }catch(IOException exc){
  19.            exc.printStackTrace();
  20.         }
  21.         return null;
  22.     }    
  23. }
  24.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement