Ver Mensaje Individual
  #11 (permalink)  
Antiguo 01/04/2011, 12:47
abulon81
 
Fecha de Ingreso: mayo-2010
Mensajes: 99
Antigüedad: 14 años, 9 meses
Puntos: 5
Respuesta: Error al cargar imagenes

Cita:
Iniciado por abulon81 Ver Mensaje
hey man calm down, puedes intentar con esto tambien , imprime la ruta de tu imagen solo que sin espacios.

String dirpath=getClass().getResource("tu imagen").getPath();

Saludos.
o puedes usar esto .
Código HTML:
public Image getpath() {
    String name= "/imagen.png"; 
        try
    {
        URL imgURL = PDFTableDemo.class.getResource(name);
        Image image = Toolkit.getDefaultToolkit().getImage(imgURL);
        
        System.out.println(image);

    }
    catch(Exception e) {
        e.printStackTrace();
    }
  finally {
     return image;
  }
}
I hope this helps.