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


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

resources from JAR files

X-Received by 10.224.192.199 with SMTP id dr7mr3516003qab.4.1358440223236; Thu, 17 Jan 2013 08:30:23 -0800 (PST)
X-Received by 10.49.15.100 with SMTP id w4mr1306860qec.26.1358440223164; Thu, 17 Jan 2013 08:30:23 -0800 (PST)
Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.glorb.com!p13no1032502qai.0!news-out.google.com!k2ni675qap.0!nntp.google.com!p13no1032495qai.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail
Newsgroups comp.lang.java.programmer
Date Thu, 17 Jan 2013 08:30:23 -0800 (PST)
Complaints-To groups-abuse@google.com
Injection-Info glegroupsg2000goo.googlegroups.com; posting-host=184.76.139.203; posting-account=v1lx5wkAAAALWYfGBkwkMb2guPF9cW2u
NNTP-Posting-Host 184.76.139.203
User-Agent G2/1.0
MIME-Version 1.0
Message-ID <f7a28e33-5e29-45fd-8c15-762e8ee4cdc2@googlegroups.com> (permalink)
Subject resources from JAR files
From bob smith <bob@coolfone.comze.com>
Injection-Date Thu, 17 Jan 2013 16:30:23 +0000
Content-Type text/plain; charset=ISO-8859-1
Xref csiph.com comp.lang.java.programmer:21478

Show key headers only | View raw


I have some code that reads an image from its JAR file like so:

img = ImageIO.read(frame.getClass().getResource("whatever.jpg"));

I basically just picked the "frame" object at random to call the getClass() method on it.

Is there a way to do this without picking an arbitrary object?  It seems so wrong.

Back to comp.lang.java.programmer | Previous | NextNext in thread | Find similar | Unroll thread


Thread

resources from JAR files bob smith <bob@coolfone.comze.com> - 2013-01-17 08:30 -0800
  Re: resources from JAR files markspace <markspace@nospam.nospam> - 2013-01-17 08:54 -0800
  Re: resources from JAR files Roedy Green <see_website@mindprod.com.invalid> - 2013-01-17 15:07 -0800
    Re: resources from JAR files Lew <lewbloch@gmail.com> - 2013-01-17 15:16 -0800
      Re: resources from JAR files Roedy Green <see_website@mindprod.com.invalid> - 2013-01-17 16:36 -0800
        Re: resources from JAR files Arne Vajhøj <arne@vajhoej.dk> - 2013-01-17 19:44 -0500
  Re: resources from JAR files Arne Vajhøj <arne@vajhoej.dk> - 2013-01-17 18:13 -0500
    Re: resources from JAR files BGB <cr88192@hotmail.com> - 2013-01-25 15:08 -0600
      Re: resources from JAR files Arne Vajhøj <arne@vajhoej.dk> - 2013-01-25 20:57 -0500
        Re: resources from JAR files Lew <lewbloch@gmail.com> - 2013-01-25 22:32 -0800

csiph-web