×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: Java
Posted by: salvo lucca
Added: Mar 21, 2021 4:07 PM
Views: 4735
Tags: no tags
  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.BufferedImage;
  9. import java.io.IOException;
  10. import java.util.logging.Level;
  11. import java.util.logging.Logger;
  12. import javax.imageio.ImageIO;
  13.  
  14.  
  15.  
  16. /**
  17.  *
  18.  * @author lucaf
  19.  */
  20. public class CaricattoreImmagini extends CaricatoreImmagini {
  21.    
  22. }
  23.  class CaricatoreImmagini {
  24.    
  25.     BufferedImage image;
  26.    
  27.     public BufferedImage caricaImagine (String posizione) {
  28.         try {
  29.             image = ImageIO.read(getClass().getResource(posizione));
  30.         } catch (IOException ex) {
  31.          System.out.println("caricata correttamente!"+
  32.             "Immagine alla posizione:"+posizione);
  33.             Logger.getLogger(CaricatoreImmagini.class.getName()).log(Level.
  34.                     SEVERE, null, ex);
  35.         }
  36.        
  37.       return image;  
  38.     }
  39.  
  40.     BufferedImage CaricaImmagini(String immaginisfondopng) {
  41.         throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
  42.     }
  43.  
  44.     BufferedImage CaricaImmagine(String immaginisfondopng) {
  45.         throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
  46.     }
  47.    
  48. }
  49.    
  50.  
  51.