Advertisement
sergAccount

Untitled

Dec 26th, 2020
1,071
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.66 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.     // метод для загрузки из-я по имени файла    
  16.     public static Image loadImage(String fileName) {
  17.         //
  18.         try {
  19.             return ImageIO.read(new File(fileName));
  20.         } catch (IOException ex) {
  21.             ex.printStackTrace();
  22.         }
  23.         return null;
  24.     }
  25. }
  26.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement