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

Payment information shows nothing in one page checkout page magento -

tcpdump - How to check if server received packet (acknowledged) -