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

javascript - AngularJS custom datepicker directive -

javascript - jQuery date picker - Disable dates after the selection from the first date picker -