Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #26204

Re: Images out of a jar

Date 2011-01-28 21:36 -0500
From Arne Vajhøj <arne@vajhoej.dk>
Newsgroups comp.lang.java.programmer
Subject Re: Images out of a jar
References <ihvsei$a57$1@news.eternal-september.org>
Message-ID <4d437d24$0$23752$14726298@news.sunsite.dk> (permalink)
Organization SunSITE.dk - Supporting Open source

Show all headers | View raw


On 28-01-2011 21:01, Sam Takoy wrote:
> Can someone point to a source where it is explained how to add image
> files to a jar and then use them in an applet. I'm not able to find the
> info regarding where to put the image within the jar and then how to
> extract it later.

They can be anywhere but maybe something like:
    images/foobar.jpg
would be logical.

new ImageIcon(getClass().getResource("images/foobar.jpg"))

should get the image in a form that be used by Swing controls.

Arne

Back to comp.lang.java.programmer | Previous | Next | Find similar


Thread

Re: Images out of a jar Arne Vajhøj <arne@vajhoej.dk> - 2011-01-28 21:36 -0500

csiph-web