Michael Dunn wrote:for .jar images look into
getResource(...)
naveen yadav wrote:ImageIcon image = (new ImageIcon(getClass().getResource("images/dice.gif")));
Is it fine ?
naveen yadav wrote:why getClass().getResource(path) returning null Although path is "E:\codes\images\animate.gif" ?
Paul Clapham wrote:
naveen yadav wrote:why getClass().getResource(path) returning null Although path is "E:\codes\images\animate.gif" ?
Are you kidding? All through this thread you've been saying that the image is in a jar, and now you're turning around and saying it's in a file after all? That's just ridiculous.
SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6 - OCEJPAD 6
How To Ask Questions How To Answer Questions
Rob Spoor wrote:The images folder should be put inside your JAR file relative to the class file.
SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6 - OCEJPAD 6
How To Ask Questions How To Answer Questions
Rob Spoor wrote:Is the package structure inside the JAR file still present? You can use any ZIP program to check.
SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6 - OCEJPAD 6
How To Ask Questions How To Answer Questions
SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6 - OCEJPAD 6
How To Ask Questions How To Answer Questions
I brought this back from the farm where they grow the tiny ads:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
|