I have the following code:
labelShowImagenApp.setIcon(new ImageIcon(rutaAbs.toURI().toURL()));
where rutaAbs
is a path to an image file.
The problem is that when that path contains spaces (like "im a png.png") it doesn't work, the label remains empty.
Hope someone can help me, thanks.
edit: I have noticed that if a folder that contains the image has spaces, it will not work either.
I have fixed it doing this:
Thanks a lot everyone for your answers.