java - JAR file is not showing images -


i working on school management application in java. when build jar file & open in winrar, resources including images folder there. going in netbeans when run jar file, doesn't display images.

my directory loos this:

  • sms
    • myapp.java
  • images
    • all required images here..

the code is:

iconadd = new imageicon(getclass().getresource("../images/add.png")); add = new jbutton(iconadd); add.setpreferredsize(new dimension(130, 100)); add.setborder(new lineborder(color.decode("#a2bdbf"), 1, true)); add.setcursor(cursor.getpredefinedcursor(12)); gbc.gridx = 0; gbc.gridy = 0; gbc.anchor = gridbagconstraints.northwest; gbc.insets = new insets(10, 10, 10, 10); leftpane.add(add, gbc);  

like above, i'm adding required images. in netbeans, working fine jar file not displaying image. know there similar questions didn't me. appreciated. in advance.

put images in project directory , create , run jar file.maybe help.


Comments

Popular posts from this blog

Is there a better way to structure post methods in Class Based Views -

performance - Why is XCHG reg, reg a 3 micro-op instruction on modern Intel architectures? -

jquery - Responsive Navbar with Sub Navbar -