java - adding pictures to .JAR file -


i tried add 3 pictures program, when add pictures, created .jar file cannot start.

when try clean , build without pictures .jar file works well.

the pictures path: d:\desktop\password\src\resources

final public imageicon picture = new imageicon(getclass().getresource("./resources/picture.png")); final public imageicon picture1 = new imageicon(getclass().getresource("./resources/picture1.jpg")); final public imageicon picture2  = new imageicon(getclass().getresource("./resources/picture2.jpg")); 

from netbeans icons visible, , program works correctly.

what did wrong?


Comments

Popular posts from this blog

amazon web services - S3 Pre-signed POST validate file type? -

c# - Check Keyboard Input Winforms -