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

How to use SUM() in MySQL for calculated values -

ios - IBOutlet for image button not correctly referencing button after recreating outlet -

java - AEM: 403 Forbidden occurs when call a Post servlet -