Java applet icon doesn't show

Posted by user295744 on Stack Overflow See other posts from Stack Overflow or by user295744
Published on 2010-04-16T16:35:31Z Indexed on 2010/12/24 15:54 UTC
Read the original article Hit count: 239

Filed under:
|
|
|

I have a java applet where I've changed the image icon that appears in the top left corner of the window. The code I use is this:

    Toolkit kit = Toolkit.getDefaultToolkit();
    Image frameIcon = kit.getImage("src/myapp/resources/logo.png");        
    getFrame().setIconImage(frameIcon);

Everything works fine until I deploy the applet to a standalone jar. In this case the icon that shows is the default icon, as if the code couldn't find the image. But the image is inside, although it is in the folder: myapp/resources/

What am I doing wrong here? Is this some weird java bug?

© Stack Overflow or respective owner

Related posts about java

Related posts about jar