<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Desktop Java application and image folders</title>
	<atom:link href="http://www.rajeshpg.com/blog/2007/12/desktop-java-application-and-image-folders/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.rajeshpg.com/blog/2007/12/desktop-java-application-and-image-folders/</link>
	<description>to innovate,to leverage, to elevate</description>
	<lastBuildDate>Thu, 30 Jul 2009 19:56:55 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
	<item>
		<title>By: Luiz</title>
		<link>http://www.rajeshpg.com/blog/2007/12/desktop-java-application-and-image-folders/comment-page-1/#comment-24</link>
		<dc:creator>Luiz</dc:creator>
		<pubDate>Thu, 20 Dec 2007 04:45:08 +0000</pubDate>
		<guid isPermaLink="false">http://rajeshpg.com/2007/12/07/desktop-java-application-and-image-folders/#comment-24</guid>
		<description>I&#039;m using Eclipse 3.3 (europa)
In order to get image loading directly from the IDE, and from inside a jar, I had to do this:

&lt;code&gt;
BufferedImage myImage = null;
String imagePath = &quot;some/directory/image.png&quot;;

try {
	if (this.getClass().getResource(&quot;/&quot; + imagePath) != null) {
		InputStream imageStream = this.getClass().getResourceAsStream(&quot;/&quot; + imagePath);
		myImage = ImageIO.read(imageStream);
	} else {
		myImage = ImageIO.read(new File(imagePath));
	}
} catch (IOException e) {
}
&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>I&#8217;m using Eclipse 3.3 (europa)<br />
In order to get image loading directly from the IDE, and from inside a jar, I had to do this:</p>
<p><code><br />
BufferedImage myImage = null;<br />
String imagePath = "some/directory/image.png";</p>
<p>try {<br />
	if (this.getClass().getResource("/" + imagePath) != null) {<br />
		InputStream imageStream = this.getClass().getResourceAsStream("/" + imagePath);<br />
		myImage = ImageIO.read(imageStream);<br />
	} else {<br />
		myImage = ImageIO.read(new File(imagePath));<br />
	}<br />
} catch (IOException e) {<br />
}<br />
</code></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Prasanna</title>
		<link>http://www.rajeshpg.com/blog/2007/12/desktop-java-application-and-image-folders/comment-page-1/#comment-23</link>
		<dc:creator>Prasanna</dc:creator>
		<pubDate>Sun, 16 Dec 2007 07:27:00 +0000</pubDate>
		<guid isPermaLink="false">http://rajeshpg.com/2007/12/07/desktop-java-application-and-image-folders/#comment-23</guid>
		<description>Sounds Good...It&#039;s good to experience Java Swing too :-)</description>
		<content:encoded><![CDATA[<p>Sounds Good&#8230;It&#8217;s good to experience Java Swing too <img src='http://www.rajeshpg.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
</channel>
</rss>
