java - Is it possible to specify the path of a chosen image with a variable? -


is possible determine path of chosen image variable? this:

private jlabel label = new jlabel(); int number = 1; label.seticon(new imageicon(getclass().getresource("/image" + number + ".png"))); 

in case not work, idea might clear. in case change variable name in order change path of image. know how so?


Comments

Popular posts from this blog

r - Trouble relying on third party package imports in my package -

Payment information shows nothing in one page checkout page magento -