Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

"I'm sure the path to the picture is good"

let me bet against that ;)

getClass().getResource("lena.png").getPath()

just try to replace that monster with an absolute path for starters, like:

"/home/me/lena.png", or "c:/me/ma/miao/lena.png" // note : "/", not "\"

"I'm sure the path to the picture is good"

let me bet against that ;)

getClass().getResource("lena.png").getPath()

just try to replace that monster with an absolute path for starters, like:

"/home/me/lena.png", or "c:/me/ma/miao/lena.png" // note : "/", not "\"

(an empty image is quite typical for imread not finding it)