document.write('
Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. import javax.swing.ImageIcon;
  2. import javax.swing.JLabel;
  3.  
  4. /*
  5.  * To change this template, choose Tools | Templates
  6.  * and open the template in the editor.
  7.  */
  8.  
  9. /**
  10.  *
  11.  * @author Charleston Anjos
  12.  */
  13. public class clsRedimensionarImagem {
  14.    
  15.     /*
  16.      * @param receber icone, largura e altura desejeda
  17.      * @return retorna a imagem redimensionada
  18.      */
  19.     public ImageIcon redimensionar(JLabel jLabel, int xLargura, int yAltura){
  20.        
  21.         ImageIcon img = new ImageIcon (jLabel.getIcon().toString());  
  22.         img.setImage(img.getImage().getScaledInstance(xLargura, yAltura, 100));
  23.        
  24.         return img;
  25.     }
  26.    
  27. }
');