java - Add images to JButton in Eclipse -
i new programmer , have started using eclipse. previously, used jgrasp , when wanted add image button did create image
folder within class's folder , write:
seticon(newimageicon(this.getclass().getresource("/images/name.png")));
i tried same thing eclipse main:nullpointerexception
error.
read post , added source folder
project named images
nothing changed. following code segment have issue with:
resetbutton.seticon(newimageicon(this.getclass().getresource("/images/helpicon.png")));
you on right way. had added resource folder. additional root resources. here, in folder (as root) have create /image folder , put files it:
Comments
Post a Comment