<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Software Passion</title>
	<atom:link href="http://www.softwarepassion.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.softwarepassion.com</link>
	<description>by Krzysztof Grajek</description>
	<lastBuildDate>Thu, 25 Feb 2010 11:56:38 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Android Series: Parsing JSON data with GSON</title>
		<link>http://www.softwarepassion.com/android-series-parsing-json-data-with-gson/</link>
		<comments>http://www.softwarepassion.com/android-series-parsing-json-data-with-gson/#comments</comments>
		<pubDate>Thu, 25 Feb 2010 11:56:03 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Code Snippets]]></category>
		<category><![CDATA[Mobile Development]]></category>

		<guid isPermaLink="false">http://www.softwarepassion.com/?p=377</guid>
		<description><![CDATA[Today I will describe how to parse json data using Gson open source library and how to convert it at the same time to java objects.
This is a typical cookbook example and should be very easy to follow.
1. Create an Android application with one activity, name it as you wish, if you are doing it [...]]]></description>
			<content:encoded><![CDATA[<p>Today I will describe how to parse json data using Gson open source library and how to convert it at the same time to java objects.<br />
This is a typical cookbook example and should be very easy to follow.<br />
1. Create an Android application with one activity, name it as you wish, if you are doing it in eclipse all the basic stuff will be generated for you which is exactly what we need.<br />
2. Find an example url which  responds in JSON, I have used Twitter Trends found here: <a href="http://search.twitter.com/trends.json">http://search.twitter.com/trends.json</a><br />
The example response looks like this:</p>
<div class="codecolorer-container html4strict " style="overflow:auto;white-space:nowrap;width:535px"><div class="html4strict codecolorer" style="font-family:Monaco,Lucida Console,monospace">{&quot;as_of&quot;:&quot;Thu, 25 Feb 2010 11:30:17 +0000&quot;,&quot;trends&quot;:[{&quot;name&quot;:&quot;#nowplaying&quot;,&quot;url&quot;:&quot;http://search.twitter.com/search?q=%23nowplaying&quot;},{&quot;name&quot;:&quot;#nothingworsethan&quot;,&quot;url&quot;:&quot;http://search.twitter.com/search?q=%23nothingworsethan&quot;},{&quot;name&quot;:&quot;Dubai Mall&quot;,&quot;url&quot;:&quot;http://search.twitter.com/search?q=%22Dubai+Mall%22&quot;},{&quot;name&quot;:&quot;iPad Gets&quot;,&quot;url&quot;:&quot;http://search.twitter.com/search?q=%22iPad+Gets%22&quot;},{&quot;name&quot;:&quot;#SuperJuniorTrot&quot;,&quot;url&quot;:&quot;http://search.twitter.com/search?q=%23SuperJuniorTrot&quot;},{&quot;name&quot;:&quot;Justin Bieber&quot;,&quot;url&quot;:&quot;http://search.twitter.com/search?q=%22Justin+Bieber%22&quot;},{&quot;name&quot;:&quot;Click&quot;,&quot;url&quot;:&quot;http://search.twitter.com/search?q=Click&quot;},{&quot;name&quot;:&quot;Jaebum&quot;,&quot;url&quot;:&quot;http://search.twitter.com/search?q=Jaebum&quot;},{&quot;name&quot;:&quot;#tosavemoney&quot;,&quot;url&quot;:&quot;http://search.twitter.com/search?q=%23tosavemoney&quot;},{&quot;name&quot;:&quot;Protection&quot;,&quot;url&quot;:&quot;http://search.twitter.com/search?q=Protection&quot;}]}</div></div>
<p>As you can see this json data contains date attribute called &#8216;as_of&#8217; as well as array of items, each consisting of name and url attributes.<br />
We will create two simple java classes wich will hold that information.<br />
First one is TwitterTrends.java</p>
<div class="codecolorer-container java " style="overflow:auto;white-space:nowrap;width:535px;height:300px"><div class="java codecolorer" style="font-family:Monaco,Lucida Console,monospace"><span class="kw1">package</span> <span class="co2">com.softwarepassion.jsonexample</span><span class="sy0">;</span><br />
<br />
<span class="kw1">import</span> <span class="co2">java.util.Date</span><span class="sy0">;</span><br />
<span class="kw1">import</span> <span class="co2">java.util.List</span><span class="sy0">;</span><br />
<br />
<span class="kw1">public</span> <span class="kw1">class</span> TwitterTrends <span class="br0">&#123;</span><br />
<br />
&nbsp; &nbsp; <span class="kw1">private</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span class="kw3">String</span></a> as_of<span class="sy0">;</span><br />
&nbsp; &nbsp; <span class="kw1">private</span> List<span class="sy0">&lt;</span>TwitterTrend<span class="sy0">&gt;</span> trends<span class="sy0">;</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span class="kw1">public</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span class="kw3">String</span></a> getAs_of<span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">return</span> as_of<span class="sy0">;</span><br />
&nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; <span class="kw1">public</span> <span class="kw4">void</span> setAs_of<span class="br0">&#40;</span><a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span class="kw3">String</span></a> asOf<span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; as_of <span class="sy0">=</span> asOf<span class="sy0">;</span><br />
&nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; <span class="kw1">public</span> List<span class="sy0">&lt;</span>TwitterTrend<span class="sy0">&gt;</span> getTrends<span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">return</span> trends<span class="sy0">;</span><br />
&nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; <span class="kw1">public</span> <span class="kw4">void</span> setTrends<span class="br0">&#40;</span>List<span class="sy0">&lt;</span>TwitterTrend<span class="sy0">&gt;</span> trends<span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">this</span>.<span class="me1">trends</span> <span class="sy0">=</span> trends<span class="sy0">;</span><br />
&nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <br />
<span class="br0">&#125;</span></div></div>
<p>And the second one is a simple TwitterTrend.java</p>
<div class="codecolorer-container java " style="overflow:auto;white-space:nowrap;width:535px"><div class="java codecolorer" style="font-family:Monaco,Lucida Console,monospace"><span class="kw1">package</span> <span class="co2">com.softwarepassion.jsonexample</span><span class="sy0">;</span><br />
<br />
<span class="kw1">public</span> <span class="kw1">class</span> TwitterTrend <span class="br0">&#123;</span><br />
&nbsp; &nbsp; <span class="kw1">private</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span class="kw3">String</span></a> name<span class="sy0">;</span><br />
&nbsp; &nbsp; <span class="kw1">private</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span class="kw3">String</span></a> url<span class="sy0">;</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span class="kw1">public</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span class="kw3">String</span></a> getName<span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">return</span> name<span class="sy0">;</span><br />
&nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; <span class="kw1">public</span> <span class="kw4">void</span> setName<span class="br0">&#40;</span><a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span class="kw3">String</span></a> name<span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">this</span>.<span class="me1">name</span> <span class="sy0">=</span> name<span class="sy0">;</span><br />
&nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; <span class="kw1">public</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span class="kw3">String</span></a> getUrl<span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">return</span> url<span class="sy0">;</span><br />
&nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; <span class="kw1">public</span> <span class="kw4">void</span> setUrl<span class="br0">&#40;</span><a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span class="kw3">String</span></a> url<span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">this</span>.<span class="me1">url</span> <span class="sy0">=</span> url<span class="sy0">;</span><br />
&nbsp; &nbsp; <span class="br0">&#125;</span><br />
<span class="br0">&#125;</span></div></div>
<p>TwitterTrends contains a list of TwitterTrend objects, both of them are simple beans and are very similar to the json response if you look closely <img src='http://www.softwarepassion.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> .</p>
<p>Now the fun part begins.</p>
<p>Download the Gson library from <a href="http://code.google.com/p/google-gson/">http://code.google.com/p/google-gson/</a> and add it to your java build path in eclipse.<br />
Once you do that, you can now transform your json response to Java object on Android Platform:<br />
Get the response as InputStream:</p>
<div class="codecolorer-container java " style="overflow:auto;white-space:nowrap;width:535px"><div class="java codecolorer" style="font-family:Monaco,Lucida Console,monospace"><span class="kw1">public</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Ainputstream+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span class="kw3">InputStream</span></a> getJSONData<span class="br0">&#40;</span><a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span class="kw3">String</span></a> url<span class="br0">&#41;</span><span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; DefaultHttpClient httpClient <span class="sy0">=</span> <span class="kw1">new</span> DefaultHttpClient<span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; URI uri<span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Ainputstream+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span class="kw3">InputStream</span></a> data <span class="sy0">=</span> <span class="kw2">null</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">try</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; uri <span class="sy0">=</span> <span class="kw1">new</span> URI<span class="br0">&#40;</span>url<span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; HttpGet method <span class="sy0">=</span> <span class="kw1">new</span> HttpGet<span class="br0">&#40;</span>uri<span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; HttpResponse response <span class="sy0">=</span> httpClient.<span class="me1">execute</span><span class="br0">&#40;</span>method<span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; data <span class="sy0">=</span> response.<span class="me1">getEntity</span><span class="br0">&#40;</span><span class="br0">&#41;</span>.<span class="me1">getContent</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span> <span class="kw1">catch</span> <span class="br0">&#40;</span><a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Aexception+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span class="kw3">Exception</span></a> e<span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; e.<span class="me1">printStackTrace</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">return</span> data<span class="sy0">;</span><br />
&nbsp; &nbsp; <span class="br0">&#125;</span></div></div>
<p>Then use that input stream to create your java objects:</p>
<div class="codecolorer-container java " style="overflow:auto;white-space:nowrap;width:535px"><div class="java codecolorer" style="font-family:Monaco,Lucida Console,monospace"><span class="kw1">public</span> <span class="kw4">void</span> runJSONParser<span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">try</span><span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; Log.<span class="me1">i</span><span class="br0">&#40;</span><span class="st0">&quot;MY INFO&quot;</span>, <span class="st0">&quot;Json Parser started..&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; Gson gson <span class="sy0">=</span> <span class="kw1">new</span> Gson<span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Areader+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span class="kw3">Reader</span></a> r <span class="sy0">=</span> <span class="kw1">new</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Ainputstreamreader+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span class="kw3">InputStreamReader</span></a><span class="br0">&#40;</span>getJSONData<span class="br0">&#40;</span><span class="st0">&quot;http://search.twitter.com/trends.json&quot;</span><span class="br0">&#41;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; Log.<span class="me1">i</span><span class="br0">&#40;</span><span class="st0">&quot;MY INFO&quot;</span>, r.<span class="me1">toString</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; TwitterTrends objs <span class="sy0">=</span> gson.<span class="me1">fromJson</span><span class="br0">&#40;</span>r, TwitterTrends.<span class="kw1">class</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; Log.<span class="me1">i</span><span class="br0">&#40;</span><span class="st0">&quot;MY INFO&quot;</span>, <span class="st0">&quot;&quot;</span><span class="sy0">+</span>objs.<span class="me1">getTrends</span><span class="br0">&#40;</span><span class="br0">&#41;</span>.<span class="me1">size</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">for</span><span class="br0">&#40;</span>TwitterTrend tr <span class="sy0">:</span> objs.<span class="me1">getTrends</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#41;</span><span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Log.<span class="me1">i</span><span class="br0">&#40;</span><span class="st0">&quot;TRENDS&quot;</span>, tr.<span class="me1">getName</span><span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="sy0">+</span> <span class="st0">&quot; - &quot;</span> <span class="sy0">+</span> tr.<span class="me1">getUrl</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><span class="kw1">catch</span><span class="br0">&#40;</span><a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Aexception+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span class="kw3">Exception</span></a> ex<span class="br0">&#41;</span><span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ex.<span class="me1">printStackTrace</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; <span class="br0">&#125;</span></div></div>
<p>Easy ha!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.softwarepassion.com/android-series-parsing-json-data-with-gson/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Apache Click on Google App Engine &#8211; Hello World Example</title>
		<link>http://www.softwarepassion.com/apache-click-on-google-app-engine-hello-world-example/</link>
		<comments>http://www.softwarepassion.com/apache-click-on-google-app-engine-hello-world-example/#comments</comments>
		<pubDate>Fri, 19 Feb 2010 10:44:47 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Cloud Computing]]></category>
		<category><![CDATA[General Programming]]></category>
		<category><![CDATA[apache click]]></category>
		<category><![CDATA[google app engine]]></category>

		<guid isPermaLink="false">http://www.softwarepassion.com/?p=369</guid>
		<description><![CDATA[Hello World!
If this blog would run on App Engine and was build with Apache Click I could finish this tutorial right here  .
But more seriously, I will describe short step by step tutorial on how to get started with Apache Click on Google App Engine.
I&#8217;m assuming that you have GAE plugin for eclipse installed [...]]]></description>
			<content:encoded><![CDATA[<p>Hello World!<br />
If this blog would run on App Engine and was build with Apache Click I could finish this tutorial right here <img src='http://www.softwarepassion.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> .<br />
But more seriously, I will describe short step by step tutorial on how to get started with Apache Click on Google App Engine.<br />
I&#8217;m assuming that you have GAE plugin for eclipse installed already as well as the latest libraries for Apache Click downloaded somewhere on your machine. (If not look at my previous post on how to get started with Apache Click on Eclipse Galileo (<a href="http://www.softwarepassion.com/getting-started-with-apache-click-and-eclipse-galileo/">here</a>).</p>
<p>If all is set up, lets get started..</p>
<p>1. Add new GAE type &#8216;Web Application Project&#8217; (the one with blue google icon)</p>
<p><a href="http://softwarepassion.s3.amazonaws.com/wp-content/uploads/add_new_google_Web_toolkit_project.jpg" rel="lightbox[369]"><img src="http://softwarepassion.s3.amazonaws.com/wp-content/uploads/add_new_google_Web_toolkit_project-263x300.jpg" alt="" title="add_new_google_Web_toolkit_project" width="263" height="300" class="aligncenter size-medium wp-image-372" /></a></p>
<p>2. Copy <strong>click-2.1.0.jar</strong> and <strong>click-extras-2.1.0.jar</strong> to the lib directory under war/WEB-INF/lib of your GAE project.</p>
<p><a href="http://softwarepassion.s3.amazonaws.com/wp-content/uploads/add_libraries.jpg" rel="lightbox[369]"><img src="http://softwarepassion.s3.amazonaws.com/wp-content/uploads/add_libraries-253x300.jpg" alt="" title="add_libraries" width="253" height="300" class="aligncenter size-medium wp-image-370" /></a></p>
<p>3. Click on the project and select &#8216;Properties&#8217; when you will modify the &#8216;Java Build Path&#8217;.<br />
<a href="http://softwarepassion.s3.amazonaws.com/wp-content/uploads/change_java_build_path.jpg" rel="lightbox[369]"><img src="http://softwarepassion.s3.amazonaws.com/wp-content/uploads/change_java_build_path-300x226.jpg" alt="" title="change_java_build_path" width="300" height="226" class="aligncenter size-medium wp-image-371" /></a></p>
<p>When changing the build path, select the two libraries you have added to you lib folder in point 2.</p>
<p><a href="http://softwarepassion.s3.amazonaws.com/wp-content/uploads/change_build_path2.jpg" rel="lightbox[369]"><img src="http://softwarepassion.s3.amazonaws.com/wp-content/uploads/change_build_path2-263x300.jpg" alt="" title="change_build_path2" width="263" height="300" class="aligncenter size-medium wp-image-373" /></a></p>
<p>4. Delete the auto-generated GAE project stuff, like servlet and index.html files.<br />
5. Create new class called &#8216;Index&#8217;</p>
<div class="codecolorer-container java " style="overflow:auto;white-space:nowrap;width:535px"><div class="java codecolorer" style="font-family:Monaco,Lucida Console,monospace"><span class="kw1">package</span> <span class="co2">com.softwarepassion.clickgae</span><span class="sy0">;</span><br />
<br />
<span class="kw1">import</span> <span class="co2">java.util.Date</span><span class="sy0">;</span><br />
<span class="kw1">import</span> <span class="co2">org.apache.click.Page</span><span class="sy0">;</span><br />
<br />
<span class="kw1">public</span> <span class="kw1">class</span> Index <span class="kw1">extends</span> Page<span class="br0">&#123;</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span class="kw1">private</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Adate+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span class="kw3">Date</span></a> time <span class="sy0">=</span> <span class="kw1">new</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Adate+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span class="kw3">Date</span></a><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
<br />
&nbsp; &nbsp; <span class="kw1">public</span> Index<span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; addModel<span class="br0">&#40;</span><span class="st0">&quot;time&quot;</span>, time<span class="br0">&#41;</span><span class="sy0">;</span> <br />
&nbsp; &nbsp; <span class="br0">&#125;</span><br />
<br />
<span class="br0">&#125;</span></div></div>
<p>Note the package you choose for you newly created class file, it will be needed when modifying config files later.</p>
<p>6. Create <strong>click.xml</strong> file in the same location where your <strong>web.xml</strong> file exists.<br />
7. Modify your <strong>web.xml </strong> file to look similar to the one presented below:</p>
<div class="codecolorer-container xml " style="overflow:auto;white-space:nowrap;width:535px"><div class="xml codecolorer" style="font-family:Monaco,Lucida Console,monospace"><span class="sc3"><span class="re1">&lt;?xml</span> <span class="re0">version</span>=<span class="st0">&quot;1.0&quot;</span> <span class="re0">encoding</span>=<span class="st0">&quot;UTF-8&quot;</span><span class="re2">?&gt;</span></span><br />
<span class="sc3"><span class="re1">&lt;web-app</span> <span class="re0">xmlns:xsi</span>=<span class="st0">&quot;http://www.w3.org/2001/XMLSchema-instance&quot;</span> <span class="re0">xmlns</span>=<span class="st0">&quot;http://java.sun.com/xml/ns/javaee&quot;</span> <span class="re0">xmlns:web</span>=<span class="st0">&quot;http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd&quot;</span> <span class="re0">xsi:schemaLocation</span>=<span class="st0">&quot;http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd&quot;</span> <span class="re0">id</span>=<span class="st0">&quot;WebApp_ID&quot;</span> <span class="re0">version</span>=<span class="st0">&quot;2.5&quot;</span><span class="re2">&gt;</span></span><br />
&nbsp; <span class="sc3"><span class="re1">&lt;listener<span class="re2">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class="sc3"><span class="re1">&lt;listener-class<span class="re2">&gt;</span></span></span>org.apache.click.extras.gae.GoogleAppEngineListener<span class="sc3"><span class="re1">&lt;/listener-class<span class="re2">&gt;</span></span></span><br />
&nbsp; <span class="sc3"><span class="re1">&lt;/listener<span class="re2">&gt;</span></span></span><br />
&nbsp; <span class="sc3"><span class="re1">&lt;servlet<span class="re2">&gt;</span></span></span><br />
&nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;servlet-name<span class="re2">&gt;</span></span></span>ClickServlet<span class="sc3"><span class="re1">&lt;/servlet-name<span class="re2">&gt;</span></span></span><br />
&nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;servlet-class<span class="re2">&gt;</span></span></span>org.apache.click.ClickServlet<span class="sc3"><span class="re1">&lt;/servlet-class<span class="re2">&gt;</span></span></span><br />
&nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;load-on-startup<span class="re2">&gt;</span></span></span>0<span class="sc3"><span class="re1">&lt;/load-on-startup<span class="re2">&gt;</span></span></span><br />
&nbsp; <span class="sc3"><span class="re1">&lt;/servlet<span class="re2">&gt;</span></span></span><br />
&nbsp; <span class="sc3"><span class="re1">&lt;servlet-mapping<span class="re2">&gt;</span></span></span><br />
&nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;servlet-name<span class="re2">&gt;</span></span></span>ClickServlet<span class="sc3"><span class="re1">&lt;/servlet-name<span class="re2">&gt;</span></span></span><br />
&nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;url-pattern<span class="re2">&gt;</span></span></span>*.htm<span class="sc3"><span class="re1">&lt;/url-pattern<span class="re2">&gt;</span></span></span><br />
&nbsp; <span class="sc3"><span class="re1">&lt;/servlet-mapping<span class="re2">&gt;</span></span></span><br />
&nbsp; <span class="sc3"><span class="re1">&lt;welcome-file-list<span class="re2">&gt;</span></span></span><br />
&nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;welcome-file<span class="re2">&gt;</span></span></span>index.htm<span class="sc3"><span class="re1">&lt;/welcome-file<span class="re2">&gt;</span></span></span><br />
&nbsp; <span class="sc3"><span class="re1">&lt;/welcome-file-list<span class="re2">&gt;</span></span></span><br />
<span class="sc3"><span class="re1">&lt;/web-app<span class="re2">&gt;</span></span></span></div></div>
<p>It looks like ordinary <strong>web.xml</strong> file with one important addition: the listener section.</p>
<p>8. Add content to your <strong>click.xml</strong> file:</p>
<div class="codecolorer-container xml " style="overflow:auto;white-space:nowrap;width:535px"><div class="xml codecolorer" style="font-family:Monaco,Lucida Console,monospace"><span class="sc3"><span class="re1">&lt;?xml</span> <span class="re0">version</span>=<span class="st0">&quot;1.0&quot;</span> <span class="re0">encoding</span>=<span class="st0">&quot;UTF-8&quot;</span> <span class="re0">standalone</span>=<span class="st0">&quot;yes&quot;</span><span class="re2">?&gt;</span></span><br />
<span class="sc3"><span class="re1">&lt;click-app</span> <span class="re0">charset</span>=<span class="st0">&quot;UTF-8&quot;</span><span class="re2">&gt;</span></span><br />
&nbsp; <span class="sc3"><span class="re1">&lt;pages<span class="re2">&gt;</span></span></span><br />
&nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;page</span> <span class="re0">path</span>=<span class="st0">&quot;index.htm&quot;</span> <span class="re0">classname</span>=<span class="st0">&quot;com.softwarepassion.clickgae.Index&quot;</span><span class="re2">&gt;</span><span class="re1">&lt;/page<span class="re2">&gt;</span></span></span><br />
&nbsp; <span class="sc3"><span class="re1">&lt;/pages<span class="re2">&gt;</span></span></span><br />
&nbsp; <span class="sc3"><span class="re1">&lt;mode</span> <span class="re0">value</span>=<span class="st0">&quot;development&quot;</span><span class="re2">/&gt;</span></span><br />
<span class="sc3"><span class="re1">&lt;/click-app<span class="re2">&gt;</span></span></span></div></div>
<p>9. Add <strong>index.htm</strong> file to the war directory</p>
<div class="codecolorer-container html4strict " style="overflow:auto;white-space:nowrap;width:535px"><div class="html4strict codecolorer" style="font-family:Monaco,Lucida Console,monospace"><span class="sc2">&lt;<a href="http://december.com/html/4/element/html.html"><span class="kw2">html</span></a>&gt;</span><br />
&nbsp; <span class="sc2">&lt;<a href="http://december.com/html/4/element/body.html"><span class="kw2">body</span></a>&gt;</span><br />
<br />
&nbsp; &nbsp; <span class="sc2">&lt;<a href="http://december.com/html/4/element/h2.html"><span class="kw2">h2</span></a>&gt;</span>Hello World<span class="sc2">&lt;<span class="sy0">/</span><a href="http://december.com/html/4/element/h2.html"><span class="kw2">h2</span></a>&gt;</span><br />
<br />
&nbsp; &nbsp; Hello world from Click at $time<br />
<br />
&nbsp; <span class="sc2">&lt;<span class="sy0">/</span><a href="http://december.com/html/4/element/body.html"><span class="kw2">body</span></a>&gt;</span><br />
<span class="sc2">&lt;<span class="sy0">/</span><a href="http://december.com/html/4/element/html.html"><span class="kw2">html</span></a>&gt;</span></div></div>
<p>10. Deploy your app to Google App Engine and go to the url: http://yourappname.appspot.com</p>
<p>You should see very simple website with current time printed.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.softwarepassion.com/apache-click-on-google-app-engine-hello-world-example/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Getting started with Apache Click and Eclipse Galileo</title>
		<link>http://www.softwarepassion.com/getting-started-with-apache-click-and-eclipse-galileo/</link>
		<comments>http://www.softwarepassion.com/getting-started-with-apache-click-and-eclipse-galileo/#comments</comments>
		<pubDate>Thu, 18 Feb 2010 10:42:16 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Code Snippets]]></category>
		<category><![CDATA[General Programming]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[apache click]]></category>

		<guid isPermaLink="false">http://www.softwarepassion.com/?p=356</guid>
		<description><![CDATA[Last couple of days I read here and there about Apache Click, which is now in version 2.1.0. It looks preety cool and easy to learn, so I decided to give it a try and see for myself.
I understand that its cool to learn things using vi and shell only, but when you tried many [...]]]></description>
			<content:encoded><![CDATA[<p>Last couple of days I read here and there about Apache Click, which is now in version 2.1.0. It looks preety cool and easy to learn, so I decided to give it a try and see for myself.<br />
I understand that its cool to learn things using vi and shell only, but when you tried many frameworks before, you know how things works, you just want to see how or how not, productive you can be with the new framework, thats why I jump straight to the IDE.<br />
And here, first surprise, with apache click its&#8217; not that easy, well, I&#8217;m mean its still easy but I have encountered a few problems, and right now I would like to share the solution.<br />
First of all, I did not tried all the examples in the apache click user guide yet, haven&#8217;t build anything usefull and definietly I&#8217;m not an Apache Click expert, I think I have figured out how to plug it to Eclipse and I think this is good start <img src='http://www.softwarepassion.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> .<br />
<script type="text/javascript"><!--
google_ad_client = "pub-3015706834207881";
/* 468x15, utworzono 09-11-19 */
google_ad_slot = "3912330401";
google_ad_width = 468;
google_ad_height = 15;
//-->
</script><br />
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script><br />
Here you have a few points to build your Apache Click IDE:<br />
1. First of all download latest and greatest Eclipse Galileo from <a href="http://www.eclipse.org/downloads/">here</a> &#8211; choose Eclipse for Java EE developers<br />
2. Download Apache Click libraries from <a href="http://click.apache.org/">here</a> &#8211; choose version 2.1.0<br />
3. Download Apache Click IDE from <a href="http://click.apache.org/docs/click-ide-downloads.html">here</a> &#8211; note that it contains Click version 1.5 and it was last updated in November 2008 &#8211; maybe I&#8217;m missing something here?<br />
4. Unzip your ClickIDE and copy the &#8216;features&#8217; and &#8216;plugins&#8217; folders into your Eclipse home directory<br />
5. Unzip your latest click libraries and keep it for later <img src='http://www.softwarepassion.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br />
6. Start your Eclipse IDE and create new &#8216;Dynamic Web Project&#8217;<br />
<a href="http://softwarepassion.s3.amazonaws.com/wp-content/uploads/dynamic_web_project.jpg" rel="lightbox[356]"><img src="http://softwarepassion.s3.amazonaws.com/wp-content/uploads/dynamic_web_project-254x300.jpg" alt="" title="dynamic_web_project" width="254" height="300" class="aligncenter size-medium wp-image-361" /></a><br />
Choose target name, in this case &#8216;ClickDemo2&#8242;, select your target runtime as Tomcat 6+ etc.<br />
7. Under configuration combo box, select custom and click &#8216;Modify&#8217;<br />
<a href="http://softwarepassion.s3.amazonaws.com/wp-content/uploads/custom_click_config.jpg" rel="lightbox[356]"><img src="http://softwarepassion.s3.amazonaws.com/wp-content/uploads/custom_click_config-300x265.jpg" alt="" title="custom_click_config" width="300" height="265" class="aligncenter size-medium wp-image-359" /></a><br />
8. Select &#8216;Click&#8217; in Project Facet List and save the configuration as click config<br />
<a href="http://softwarepassion.s3.amazonaws.com/wp-content/uploads/click_config.jpg" rel="lightbox[356]"><img src="http://softwarepassion.s3.amazonaws.com/wp-content/uploads/click_config-300x232.jpg" alt="" title="click_config" width="300" height="232" class="aligncenter size-medium wp-image-357" /></a><br />
9. Once you have your configuration created, dynamic web project screen should look like in the following screenshot:<br />
<a href="http://softwarepassion.s3.amazonaws.com/wp-content/uploads/custom_click_config2.jpg" rel="lightbox[356]"><img src="http://softwarepassion.s3.amazonaws.com/wp-content/uploads/custom_click_config2-255x300.jpg" alt="" title="custom_click_config2" width="255" height="300" class="aligncenter size-medium wp-image-360" /></a><br />
10. The rest of the settings you can leave as it is, just click &#8216;Next&#8217; up to the point when you finish creating new dynamic web project.<br />
11. After your project is created it will have the structure like in the following screen:<br />
<a href="http://softwarepassion.s3.amazonaws.com/wp-content/uploads/clickdemo_project_structure.jpg" rel="lightbox[356]"><img src="http://softwarepassion.s3.amazonaws.com/wp-content/uploads/clickdemo_project_structure-274x300.jpg" alt="" title="clickdemo_project_structure" width="274" height="300" class="aligncenter size-medium wp-image-358" /></a><br />
<script type="text/javascript"><!--
google_ad_client = "pub-3015706834207881";
/* 468x15, utworzono 09-11-19 */
google_ad_slot = "3912330401";
google_ad_width = 468;
google_ad_height = 15;
//-->
</script><br />
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script><br />
Notice that there are click libraries from version 1.5, which is no good, we want to use the latest version which is 2.1.0.<br />
12. Copy the files &#8216;click-2.1.0.jar&#8217; and &#8216;click-extras-2.1.0.jar&#8217; into the same lib folder where the old libraries are found.<br />
13. Delete old libraries and refresh the project tree under eclipse (right click on the project node and select &#8216;Refresh&#8217;), now you will see the new libraries come up in the lib folder.<br />
14. Open your web.xml file under &#8216;WebContent/WEB-INF/&#8217; folder and change the class name of the main Click Servlet, from &#8216;net.sf.click.ClickServlet&#8217; to &#8216;org.apache.click.ClickServlet&#8217; in &#8217;servlet-class&#8217; declaration.<br />
15. With Eclipse, select the project node and click &#8216;New&#8217; -> &#8216;Other&#8217;, choose &#8216;Click Page&#8217; under &#8216;click&#8217; directory.<br />
<a href="http://softwarepassion.s3.amazonaws.com/wp-content/uploads/new_click_page.jpg" rel="lightbox[356]"><img src="http://softwarepassion.s3.amazonaws.com/wp-content/uploads/new_click_page-300x285.jpg" alt="" title="new_click_page" width="300" height="285" class="aligncenter size-medium wp-image-362" /></a><br />
16. Fill out the necessary fields for your new click page as below:<br />
<a href="http://softwarepassion.s3.amazonaws.com/wp-content/uploads/new_click_page2.jpg" rel="lightbox[356]"><img src="http://softwarepassion.s3.amazonaws.com/wp-content/uploads/new_click_page2-264x300.jpg" alt="" title="new_click_page2" width="264" height="300" class="aligncenter size-medium wp-image-363" /></a><br />
17. Name the file &#8216;index.htm&#8217; and click &#8216;Finish&#8217;<br />
18. Under the page java source file, fix the Page class by using the page from the: org.apache.click.Page instead of the old path.</p>
<div class="codecolorer-container java " style="overflow:auto;white-space:nowrap;width:535px"><div class="java codecolorer" style="font-family:Monaco,Lucida Console,monospace"><span class="kw1">package</span> <span class="co2">com.softwarepassion</span><span class="sy0">;</span><br />
<br />
<span class="kw1">import</span> <span class="co2">java.util.Date</span><span class="sy0">;</span><br />
<br />
<span class="kw1">import</span> <span class="co2">org.apache.click.Page</span><span class="sy0">;</span><br />
<br />
<br />
<span class="kw1">public</span> <span class="kw1">class</span> Index <span class="kw1">extends</span> Page <span class="br0">&#123;</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span class="kw1">private</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Adate+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span class="kw3">Date</span></a> time <span class="sy0">=</span> <span class="kw1">new</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Adate+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span class="kw3">Date</span></a><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span class="kw1">public</span> Index<span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; addModel<span class="br0">&#40;</span><span class="st0">&quot;time&quot;</span>, time<span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; <span class="br0">&#125;</span><br />
<br />
<span class="br0">&#125;</span></div></div>
<p>Modify your &#8216;index.htm&#8217; using html editor to look something like this:</p>
<div class="codecolorer-container html4strict " style="overflow:auto;white-space:nowrap;width:535px"><div class="html4strict codecolorer" style="font-family:Monaco,Lucida Console,monospace"><span class="sc2">&lt;<a href="http://december.com/html/4/element/html.html"><span class="kw2">html</span></a>&gt;</span><br />
&nbsp; <span class="sc2">&lt;<a href="http://december.com/html/4/element/head.html"><span class="kw2">head</span></a>&gt;</span><br />
&nbsp; &nbsp; <span class="sc2">&lt;<a href="http://december.com/html/4/element/meta.html"><span class="kw2">META</span></a> <span class="kw3">HTTP-EQUIV</span><span class="sy0">=</span><span class="st0">&quot;Content-Type&quot;</span> <span class="kw3">CONTENT</span><span class="sy0">=</span><span class="st0">&quot;text/html;charset=UTF-8&quot;</span>&gt;</span><br />
&nbsp; &nbsp; <span class="sc2">&lt;<a href="http://december.com/html/4/element/title.html"><span class="kw2">title</span></a>&gt;</span>Blank<span class="sc2">&lt;<span class="sy0">/</span><a href="http://december.com/html/4/element/title.html"><span class="kw2">title</span></a>&gt;</span><br />
&nbsp; &nbsp; $imports<br />
&nbsp; <span class="sc2">&lt;<span class="sy0">/</span><a href="http://december.com/html/4/element/head.html"><span class="kw2">head</span></a>&gt;</span><br />
&nbsp; <span class="sc2">&lt;<a href="http://december.com/html/4/element/body.html"><span class="kw2">body</span></a>&gt;</span><br />
&nbsp; $time<br />
&nbsp; <span class="sc2">&lt;<span class="sy0">/</span><a href="http://december.com/html/4/element/body.html"><span class="kw2">body</span></a>&gt;</span><br />
<span class="sc2">&lt;<span class="sy0">/</span><a href="http://december.com/html/4/element/html.html"><span class="kw2">html</span></a>&gt;</span></div></div>
<p>19. Start up your project in tomcat. The page should display current time!<br />
<script type="text/javascript"><!--
google_ad_client = "pub-3015706834207881";
/* 468x15, utworzono 09-11-19 */
google_ad_slot = "3912330401";
google_ad_width = 468;
google_ad_height = 15;
//-->
</script><br />
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script><br />
Additional Comments:<br />
I know that this is just a quickfix, and I just cannot belive that there is no proper eclipse plugin using the latest click framework, which would be up to date, if you know any, than please comment and save me and my readers precious time.</p>
<p>Thank you.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.softwarepassion.com/getting-started-with-apache-click-and-eclipse-galileo/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Jasperberry &#8211; the most dynamic reports ever.</title>
		<link>http://www.softwarepassion.com/jasperberry-the-most-dynamic-reports-ever/</link>
		<comments>http://www.softwarepassion.com/jasperberry-the-most-dynamic-reports-ever/#comments</comments>
		<pubDate>Wed, 17 Feb 2010 09:03:08 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Code Snippets]]></category>
		<category><![CDATA[General Programming]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[jasperberry]]></category>

		<guid isPermaLink="false">http://www.softwarepassion.com/?p=350</guid>
		<description><![CDATA[Today I will describe in short my latest and simplest quick and dirty trick, generating jasper report dynamically. Jasperberry is a component written very quickly to help me
generate pdf report in a situation where I don&#8217;t know the number of columns I will have, I don&#8217;t know their widths, the data they contain etc, all [...]]]></description>
			<content:encoded><![CDATA[<p>Today I will describe in short my latest and simplest quick and dirty trick, generating jasper report dynamically. Jasperberry is a component written very quickly to help me<br />
generate pdf report in a situation where I don&#8217;t know the number of columns I will have, I don&#8217;t know their widths, the data they contain etc, all is generated at runtime dynamically.<br />
I know that there is DynamicJasper project but it seems to be dead, and its dead in a very strange way, I mean, I see that the authors commit new code but there is no chance to get any support unless, I guess, you pay for it.<br />
With dynamic jasper I couldn&#8217;t generate report with polish fonts displayed properly, tried many different tricks, no support on the forum, no support on stack overflow, no nothing. After 2 days I have realized that I will write my own library quicker to solve my problem than get an answer from the dynamic jasper community (if there is any).<br />
So here we have: jasperberry!<br />
<script type="text/javascript"><!--
google_ad_client = "pub-3015706834207881";
/* 468x15, utworzono 09-11-19 */
google_ad_slot = "3912330401";
google_ad_width = 468;
google_ad_height = 15;
//-->
</script><br />
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script><br />
Don&#8217;t expect too much from it but if you want to display simple table with data, dynamic columns, adjustable fonts and colors than this is it.</p>
<p>In fact you don&#8217;t have to even know object properties to generate the report, we will use Apache DynaBeans for that:</p>
<p>This is a simple example code snipped showing you how to get started with the simplest and most dynamic reporting library ever (as well as lacking features probably but we hope its enough for simple projects)</p>
<p>This example assumes the following:</p>
<p>1. You want simple report<br />
2. You dont have to know the object which properties you want to display in advance, by this I mean you can create report columns dynamically, and by using apache dyna beans your objects don&#8217;t have to even exists. You just dynamically create them and inject them into the report.</p>
<p>Here is an example test class showing you how to use jasperberry, for more info please contact us directly at softberries.com<br />
Code:</p>
<div class="codecolorer-container java " style="overflow:auto;white-space:nowrap;width:535px;height:300px"><div class="java codecolorer" style="font-family:Monaco,Lucida Console,monospace"><span class="kw1">public</span> <span class="kw1">class</span> JRXMLBuilderTest <span class="br0">&#123;</span><br />
<br />
&nbsp; &nbsp; <span class="kw1">private</span> <span class="kw1">static</span> List<span class="sy0">&lt;</span>JBColumnBean<span class="sy0">&gt;</span> columns<span class="sy0">;</span><br />
<br />
&nbsp; &nbsp; <span class="kw1">public</span> JRXMLBuilderTest<span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; <span class="br0">&#125;</span><br />
<br />
&nbsp; &nbsp; @BeforeClass<br />
&nbsp; &nbsp; <span class="kw1">public</span> <span class="kw1">static</span> <span class="kw4">void</span> setUpClass<span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="kw1">throws</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Aexception+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span class="kw3">Exception</span></a> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; columns <span class="sy0">=</span> <span class="kw1">new</span> ArrayList<span class="sy0">&lt;</span>JBColumnBean<span class="sy0">&gt;</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; JBColumnBean col1 <span class="sy0">=</span> <span class="kw1">new</span> JBColumnBean<span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; JBColumnBean col2 <span class="sy0">=</span> <span class="kw1">new</span> JBColumnBean<span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; JBColumnBean col3 <span class="sy0">=</span> <span class="kw1">new</span> JBColumnBean<span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; JBColumnBean col4 <span class="sy0">=</span> <span class="kw1">new</span> JBColumnBean<span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; JBColumnBean col5 <span class="sy0">=</span> <span class="kw1">new</span> JBColumnBean<span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; JBColumnBean col6 <span class="sy0">=</span> <span class="kw1">new</span> JBColumnBean<span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; JBColumnBean col7 <span class="sy0">=</span> <span class="kw1">new</span> JBColumnBean<span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; col1.<span class="me1">setPreferredWidth</span><span class="br0">&#40;</span><span class="nu0">60</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; col1.<span class="me1">setProperty</span><span class="br0">&#40;</span><span class="st0">&quot;name&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; col1.<span class="me1">setTitle</span><span class="br0">&#40;</span><span class="st0">&quot;Imię&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; col2.<span class="me1">setPreferredWidth</span><span class="br0">&#40;</span><span class="nu0">60</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; col2.<span class="me1">setProperty</span><span class="br0">&#40;</span><span class="st0">&quot;surname&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; col2.<span class="me1">setTitle</span><span class="br0">&#40;</span><span class="st0">&quot;Nazwisko&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; col3.<span class="me1">setPreferredWidth</span><span class="br0">&#40;</span><span class="nu0">160</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; col3.<span class="me1">setProperty</span><span class="br0">&#40;</span><span class="st0">&quot;comment&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; col3.<span class="me1">setTitle</span><span class="br0">&#40;</span><span class="st0">&quot;Komentarz&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; col4.<span class="me1">setPreferredWidth</span><span class="br0">&#40;</span><span class="nu0">100</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; col4.<span class="me1">setProperty</span><span class="br0">&#40;</span><span class="st0">&quot;comment2&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; col4.<span class="me1">setTitle</span><span class="br0">&#40;</span><span class="st0">&quot;Komentarz&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; col5.<span class="me1">setPreferredWidth</span><span class="br0">&#40;</span><span class="nu0">100</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; col5.<span class="me1">setProperty</span><span class="br0">&#40;</span><span class="st0">&quot;comment3&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; col5.<span class="me1">setTitle</span><span class="br0">&#40;</span><span class="st0">&quot;Komentarz&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; col6.<span class="me1">setPreferredWidth</span><span class="br0">&#40;</span><span class="nu0">100</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; col6.<span class="me1">setProperty</span><span class="br0">&#40;</span><span class="st0">&quot;comment4&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; col6.<span class="me1">setTitle</span><span class="br0">&#40;</span><span class="st0">&quot;Komentarz&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; col7.<span class="me1">setPreferredWidth</span><span class="br0">&#40;</span><span class="nu0">100</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; col7.<span class="me1">setProperty</span><span class="br0">&#40;</span><span class="st0">&quot;comment5&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; col7.<span class="me1">setTitle</span><span class="br0">&#40;</span><span class="st0">&quot;Komentarz&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; columns.<span class="me1">add</span><span class="br0">&#40;</span>col1<span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; columns.<span class="me1">add</span><span class="br0">&#40;</span>col2<span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; columns.<span class="me1">add</span><span class="br0">&#40;</span>col3<span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; columns.<span class="me1">add</span><span class="br0">&#40;</span>col4<span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; columns.<span class="me1">add</span><span class="br0">&#40;</span>col5<span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; columns.<span class="me1">add</span><span class="br0">&#40;</span>col6<span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; columns.<span class="me1">add</span><span class="br0">&#40;</span>col7<span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; <span class="br0">&#125;</span><br />
<br />
&nbsp; &nbsp; @AfterClass<br />
&nbsp; &nbsp; <span class="kw1">public</span> <span class="kw1">static</span> <span class="kw4">void</span> tearDownClass<span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="kw1">throws</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Aexception+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span class="kw3">Exception</span></a> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; <span class="br0">&#125;</span><br />
<br />
&nbsp; &nbsp; @Before<br />
&nbsp; &nbsp; <span class="kw1">public</span> <span class="kw4">void</span> setUp<span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; <span class="br0">&#125;</span><br />
<br />
&nbsp; &nbsp; @After<br />
&nbsp; &nbsp; <span class="kw1">public</span> <span class="kw4">void</span> tearDown<span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; <span class="br0">&#125;</span><br />
<br />
&nbsp; &nbsp; <span class="co3">/** * Test of build method, of class JRXMLBuilder. */</span><br />
&nbsp; &nbsp; @Test<br />
&nbsp; &nbsp; <span class="kw1">public</span> <span class="kw4">void</span> testBuild<span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">try</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Asystem+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span class="kw3">System</span></a>.<span class="me1">out</span>.<span class="me1">println</span><span class="br0">&#40;</span><span class="st0">&quot;build&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; List<span class="sy0">&lt;</span>JBReportElement<span class="sy0">&gt;</span> elements <span class="sy0">=</span> <span class="kw1">new</span> ArrayList<span class="sy0">&lt;</span>JBReportElement<span class="sy0">&gt;</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">//col header font </span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; JBFont colHeaderFont <span class="sy0">=</span> <span class="kw1">new</span> JBFont<span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; colHeaderFont.<span class="me1">setBold</span><span class="br0">&#40;</span><span class="kw2">true</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; colHeaderFont.<span class="me1">setSize</span><span class="br0">&#40;</span><span class="nu0">10</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; colHeaderFont.<span class="me1">setForegroundColor</span><span class="br0">&#40;</span><span class="st0">&quot;#555555&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">//detail font </span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; JBFont detailFont <span class="sy0">=</span> <span class="kw1">new</span> JBFont<span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; detailFont.<span class="me1">setSize</span><span class="br0">&#40;</span><span class="nu0">6</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; detailFont.<span class="me1">setForegroundColor</span><span class="br0">&#40;</span><span class="st0">&quot;#000000&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; detailFont.<span class="me1">setPdfEncoding</span><span class="br0">&#40;</span><span class="st0">&quot;Cp1257&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; JBPage page <span class="sy0">=</span> <span class="kw1">new</span> JBPage<span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; JBReport report <span class="sy0">=</span> <span class="kw1">new</span> JBReport<span class="br0">&#40;</span>page, colHeaderFont, detailFont, <span class="st0">&quot;#CCCCFF&quot;</span>, <span class="st0">&quot;#DEDEDE&quot;</span>, <span class="st0">&quot;#FFFFFF&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; JBFont titleFont <span class="sy0">=</span> <span class="kw1">new</span> JBFont<span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; titleFont.<span class="me1">setBold</span><span class="br0">&#40;</span><span class="kw2">true</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; titleFont.<span class="me1">setSize</span><span class="br0">&#40;</span><span class="nu0">20</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; titleFont.<span class="me1">setForegroundColor</span><span class="br0">&#40;</span><span class="st0">&quot;#FF0000&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; titleFont.<span class="me1">setPdfEncoding</span><span class="br0">&#40;</span><span class="st0">&quot;Cp1257&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">//add title elements </span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; elements.<span class="me1">add</span><span class="br0">&#40;</span><span class="kw1">new</span> JBStaticTextElement<span class="br0">&#40;</span><span class="st0">&quot;Hello World!&quot;</span>, <span class="nu0">450</span>, <span class="nu0">10</span>, <span class="nu0">300</span>, titleFont<span class="br0">&#41;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; elements.<span class="me1">add</span><span class="br0">&#40;</span><span class="kw1">new</span> JBImageElement<span class="br0">&#40;</span><span class="st0">&quot;C:<span class="es0">\\</span><span class="es0">\\</span>Documents and Settings<span class="es0">\\</span><span class="es0">\\</span>admin<span class="es0">\\</span><span class="es0">\\</span>Moje dokumenty<span class="es0">\\</span><span class="es0">\\</span>NetBeansProjects<span class="es0">\\</span><span class="es0">\\</span>JASPER_BERRY<span class="es0">\\</span><span class="es0">\\</span>test.jpg&quot;</span>, <span class="nu0">0</span>, <span class="nu0">0</span>, <span class="nu0">350</span>, <span class="nu0">242</span><span class="br0">&#41;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; report.<span class="me1">setTitleElements</span><span class="br0">&#40;</span>elements<span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; JRXMLBuilder instance <span class="sy0">=</span> <span class="kw1">new</span> JRXMLBuilder<span class="br0">&#40;</span>columns, report<span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw4">boolean</span> expResult <span class="sy0">=</span> <span class="kw2">true</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw4">boolean</span> result <span class="sy0">=</span> instance.<span class="me1">build</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; JasperReport jr <span class="sy0">=</span> JasperCompileManager.<span class="me1">compileReport</span><span class="br0">&#40;</span><span class="st0">&quot;jasperberry_by_softberries.jrxml&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">//PREPARE SOME DATA </span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; DynaProperty<span class="br0">&#91;</span><span class="br0">&#93;</span> props <span class="sy0">=</span> <span class="kw1">new</span> DynaProperty<span class="br0">&#91;</span>columns.<span class="me1">size</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#93;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">for</span> <span class="br0">&#40;</span><span class="kw4">int</span> i <span class="sy0">=</span> <span class="nu0">0</span><span class="sy0">;</span> i <span class="sy0">&lt;</span> columns.<span class="me1">size</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span> i<span class="sy0">++</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; props<span class="br0">&#91;</span>i<span class="br0">&#93;</span> <span class="sy0">=</span> <span class="kw1">new</span> DynaProperty<span class="br0">&#40;</span>columns.<span class="me1">get</span><span class="br0">&#40;</span>i<span class="br0">&#41;</span>.<span class="me1">getProperty</span><span class="br0">&#40;</span><span class="br0">&#41;</span>, <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span class="kw3">String</span></a>.<span class="kw1">class</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; BasicDynaClass dynaClass <span class="sy0">=</span> <span class="kw1">new</span> BasicDynaClass<span class="br0">&#40;</span><span class="st0">&quot;tester&quot;</span>, <span class="kw2">null</span>, props<span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; List<span class="sy0">&lt;</span>DynaBean<span class="sy0">&gt;</span> beans <span class="sy0">=</span> <span class="kw1">new</span> ArrayList<span class="sy0">&lt;</span>DynaBean<span class="sy0">&gt;</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">for</span> <span class="br0">&#40;</span><span class="kw4">int</span> i <span class="sy0">=</span> <span class="nu0">0</span><span class="sy0">;</span> i <span class="sy0">&lt;</span> <span class="nu0">100</span><span class="sy0">;</span> i<span class="sy0">++</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; DynaBean db <span class="sy0">=</span> dynaClass.<span class="me1">newInstance</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; db.<span class="me1">set</span><span class="br0">&#40;</span><span class="st0">&quot;name&quot;</span>, <span class="st0">&quot;Krzysztof &quot;</span> <span class="sy0">+</span> i<span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; db.<span class="me1">set</span><span class="br0">&#40;</span><span class="st0">&quot;surname&quot;</span>, <span class="st0">&quot;Grajek &quot;</span> <span class="sy0">+</span> i<span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; db.<span class="me1">set</span><span class="br0">&#40;</span><span class="st0">&quot;comment&quot;</span>, <span class="st0">&quot;Komentarz &quot;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; db.<span class="me1">set</span><span class="br0">&#40;</span><span class="st0">&quot;comment2&quot;</span>, <span class="st0">&quot;Komentarz &quot;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; db.<span class="me1">set</span><span class="br0">&#40;</span><span class="st0">&quot;comment3&quot;</span>, <span class="st0">&quot;Komentarz &quot;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; db.<span class="me1">set</span><span class="br0">&#40;</span><span class="st0">&quot;comment4&quot;</span>, <span class="st0">&quot;Komentarz &quot;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">//</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; db.<span class="me1">set</span><span class="br0">&#40;</span><span class="st0">&quot;comment5&quot;</span>, <span class="st0">&quot;Komentarz &quot;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; beans.<span class="me1">add</span><span class="br0">&#40;</span>db<span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; JasperPrint jp <span class="sy0">=</span> JasperFillManager.<span class="me1">fillReport</span><span class="br0">&#40;</span>jr, <span class="kw2">null</span>, <span class="kw1">new</span> JRBeanCollectionDataSource<span class="br0">&#40;</span>beans<span class="br0">&#41;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; JasperExportManager.<span class="me1">exportReportToPdfFile</span><span class="br0">&#40;</span>jp, <span class="st0">&quot;jasperberry.pdf&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; assertEquals<span class="br0">&#40;</span>expResult, result<span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span> <span class="kw1">catch</span> <span class="br0">&#40;</span><a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Aexception+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span class="kw3">Exception</span></a> ex<span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Logger.<span class="me1">getLogger</span><span class="br0">&#40;</span>JRXMLBuilderTest.<span class="kw1">class</span>.<span class="me1">getName</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#41;</span>.<span class="me1">log</span><span class="br0">&#40;</span>Level.<span class="me1">SEVERE</span>, <span class="kw2">null</span>, ex<span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; <span class="br0">&#125;</span><br />
<span class="br0">&#125;</span></div></div>
<p>You should find similar snippet in a test suite of the project.<br />
The project itself is licensed under LGPL and its available from sourceforge <a href="http://sourceforge.net/projects/jasperberry/">here</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.softwarepassion.com/jasperberry-the-most-dynamic-reports-ever/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Deploy your Java Application with IzPack Installer</title>
		<link>http://www.softwarepassion.com/deploy-your-java-application-with-izpack-installer/</link>
		<comments>http://www.softwarepassion.com/deploy-your-java-application-with-izpack-installer/#comments</comments>
		<pubDate>Sat, 06 Feb 2010 18:16:36 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Code Snippets]]></category>
		<category><![CDATA[General Programming]]></category>
		<category><![CDATA[desktop installer]]></category>
		<category><![CDATA[izpack]]></category>
		<category><![CDATA[java]]></category>

		<guid isPermaLink="false">http://www.softwarepassion.com/?p=341</guid>
		<description><![CDATA[<span style="max-width: 100px; display: block; float: left;"><img src="http://softwarepassion.s3.amazonaws.com/wp-content/uploads/izpack_directory-300x168.png" alt="izpack installer folders" title="izpack installer content" width="100" height="100"/></span><span style="margin: 0px; padding-left: 10px; display: block; max-width: 370px; float: left;">Deploy your Java Application with IzPack Installer</span>]]></description>
			<content:encoded><![CDATA[<p>This is a short tutorial on how to create simple IzPack based installation solution on windows platform with all standard features like: desktop shortcut, start menu item shortcut, copying libraries, folders, documentation into one of the ProgramFiles folder on the windows machine.<br />
I had some problems creating windows shortcuts mysefl and I wanted to share the experience so other people can find it quicker.<br />
Here you go.<br />
<script type="text/javascript"><!--
google_ad_client = "pub-3015706834207881";
/* 468x15, utworzono 09-11-19 */
google_ad_slot = "3912330401";
google_ad_width = 468;
google_ad_height = 15;
//-->
</script><br />
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script><br />
1. First download and install IzPack itself from: <a href="http://izpack.org">izpack website</a></p>
<p>2. Prepare the application you want to make installable, I use Netbeans to build most of my Java apps, but I guess for all other ide&#8217;s the results after all are the same, we end up with SomeApp.jar file and a bunch of libraries we used to build it.<br />
On the Netbeans platform all the files needed to launch the application we have build end up in &#8216;dist&#8217; folder as a subfolder of our project main folder. If you have used any libraries to build your desktop application they will be included in the lib folder (yourproject/dist/lib/).</p>
<p>3. Now, once we have all the main ingredients (our application and installer) we need to connect it together. Create the folder anywhere on your machine, and call it for example &#8217;softwarepassion&#8217;. </p>
<p>4. Put your jar file together with the &#8216;lib&#8217; folder into the &#8217;softwarepassion&#8217; catalog.</p>
<p>5. Now we need to add some native libraries for Izpack to be able to add windows shortcuts on the desktop and start menu. Create &#8216;bin&#8217; folder under the &#8217;softwarepassion&#8217; folder and copy whole &#8216;native&#8217; content found in your izpack installation into the &#8216;bin&#8217; folder of your root &#8217;softwarepassion&#8217; catalog.<br />
You can find the native folder inside your IzPack installation directory, normally under: &#8216;C:\Program Files\IzPack\bin&#8217;</p>
<p>6. Create your application icon file and add it to your &#8217;softwarepasison&#8217; catalog. I call mine &#8216;exe.ico&#8217;.</p>
<p>7. Now comes the hardest part to get initially but after you build your first installer it all gets clear and easy <img src='http://www.softwarepassion.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br />
We need to prepare two separate xml files: one called &#8216;install.xml&#8217; and another one called &#8217;shortcutSpec.xml&#8217;.</p>
<p>The content of both example files is listed below:<br />
<script type="text/javascript"><!--
google_ad_client = "pub-3015706834207881";
/* 468x15, utworzono 09-11-19 */
google_ad_slot = "3912330401";
google_ad_width = 468;
google_ad_height = 15;
//-->
</script><br />
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
<div class="codecolorer-container xml " style="overflow:auto;white-space:nowrap;width:535px;height:300px"><div class="xml codecolorer" style="font-family:Monaco,Lucida Console,monospace"><span class="sc3"><span class="re1">&lt;?xml</span> <span class="re0">version</span>=<span class="st0">&quot;1.0&quot;</span> <span class="re0">encoding</span>=<span class="st0">&quot;iso-8859-1&quot;</span> <span class="re0">standalone</span>=<span class="st0">&quot;yes&quot;</span> <span class="re2">?&gt;</span></span><br />
<br />
<span class="sc-1">&lt;!-- </span><br />
<span class="sc-1"> &nbsp; &nbsp;A sample installation file.</span><br />
<span class="sc-1"> &nbsp; &nbsp;Use it as a base for your own installers :-)</span><br />
<span class="sc-1"> &nbsp; &nbsp;</span><br />
<span class="sc-1"> &nbsp; &nbsp;To compile it :</span><br />
<span class="sc-1"> &nbsp; &nbsp;- go in the bin directory where you installed IzPack</span><br />
<span class="sc-1"> &nbsp; &nbsp;- call &quot;compile ../sample/install.xml -b ../sample&quot;</span><br />
<span class="sc-1">--&gt;</span><br />
<br />
<span class="sc3"><span class="re1">&lt;installation</span> <span class="re0">version</span>=<span class="st0">&quot;1.0&quot;</span><span class="re2">&gt;</span></span><br />
<br />
&nbsp; &nbsp; <span class="sc-1">&lt;!-- </span><br />
<span class="sc-1"> &nbsp; &nbsp; &nbsp; &nbsp;The info section.</span><br />
<span class="sc-1"> &nbsp; &nbsp; &nbsp; &nbsp;The meaning of the tags should be natural ...</span><br />
<span class="sc-1"> &nbsp; &nbsp;--&gt;</span><br />
&nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;info<span class="re2">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;appname<span class="re2">&gt;</span></span></span>SoftwarePassion Application<span class="sc3"><span class="re1">&lt;/appname<span class="re2">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;appversion<span class="re2">&gt;</span></span></span>1.0<span class="sc3"><span class="re1">&lt;/appversion<span class="re2">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;authors<span class="re2">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;author</span> <span class="re0">name</span>=<span class="st0">&quot;Softberries Krzysztof Grajek&quot;</span> <span class="re0">email</span>=<span class="st0">&quot;customer.service@softberries.com&quot;</span><span class="re2">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;/authors<span class="re2">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;url<span class="re2">&gt;</span></span></span>http://www.softwarepassion.com/<span class="sc3"><span class="re1">&lt;/url<span class="re2">&gt;</span></span></span><br />
&nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;/info<span class="re2">&gt;</span></span></span><br />
<br />
&nbsp; &nbsp; <span class="sc-1">&lt;!-- </span><br />
<span class="sc-1"> &nbsp; &nbsp; &nbsp; &nbsp;The gui preferences indication.</span><br />
<span class="sc-1"> &nbsp; &nbsp; &nbsp; &nbsp;Sets the installer window to 640x480. It will not be able to change the size.</span><br />
<span class="sc-1"> &nbsp; &nbsp;--&gt;</span><br />
&nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;guiprefs</span> <span class="re0">width</span>=<span class="st0">&quot;640&quot;</span> <span class="re0">height</span>=<span class="st0">&quot;480&quot;</span> <span class="re0">resizable</span>=<span class="st0">&quot;yes&quot;</span><span class="re2">/&gt;</span></span><br />
&nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;variables<span class="re2">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;variable</span> <span class="re0">name</span>=<span class="st0">&quot;DesktopShortcutCheckboxEnabled&quot;</span> <span class="re0">value</span>=<span class="st0">&quot;true&quot;</span><span class="re2">/&gt;</span></span><br />
&nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;/variables<span class="re2">&gt;</span></span></span><br />
&nbsp; &nbsp; <span class="sc-1">&lt;!-- </span><br />
<span class="sc-1"> &nbsp; &nbsp; &nbsp; &nbsp;The locale section.</span><br />
<span class="sc-1"> &nbsp; &nbsp; &nbsp; &nbsp;Asks here to include the English and French langpacks.</span><br />
<span class="sc-1"> &nbsp; &nbsp;--&gt;</span><br />
&nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;locale<span class="re2">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;langpack</span> <span class="re0">iso3</span>=<span class="st0">&quot;pol&quot;</span><span class="re2">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;langpack</span> <span class="re0">iso3</span>=<span class="st0">&quot;eng&quot;</span><span class="re2">/&gt;</span></span><br />
&nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;/locale<span class="re2">&gt;</span></span></span><br />
<br />
&nbsp; &nbsp; <span class="sc-1">&lt;!-- </span><br />
<span class="sc-1"> &nbsp; &nbsp; &nbsp; &nbsp;The resources section.</span><br />
<span class="sc-1"> &nbsp; &nbsp; &nbsp; &nbsp;The ids must be these ones if you want to use the LicencePanel and/or the InfoPanel.</span><br />
<span class="sc-1"> &nbsp; &nbsp;--&gt;</span><br />
&nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;resources<span class="re2">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;res</span> <span class="re0">src</span>=<span class="st0">&quot;shortcutSpec.xml&quot;</span> <span class="re0">id</span>=<span class="st0">&quot;shortcutSpec.xml&quot;</span><span class="re2">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;res</span> <span class="re0">id</span>=<span class="st0">&quot;LicencePanel.licence&quot;</span> <span class="re0">src</span>=<span class="st0">&quot;Licence.txt&quot;</span><span class="re2">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;res</span> <span class="re0">id</span>=<span class="st0">&quot;InfoPanel.info&quot;</span> <span class="re0">src</span>=<span class="st0">&quot;Readme.txt&quot;</span><span class="re2">/&gt;</span></span><br />
&nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;/resources<span class="re2">&gt;</span></span></span><br />
<br />
&nbsp; &nbsp; <span class="sc-1">&lt;!-- </span><br />
<span class="sc-1"> &nbsp; &nbsp; &nbsp; &nbsp;The panels section.</span><br />
<span class="sc-1"> &nbsp; &nbsp; &nbsp; &nbsp;We indicate here which panels we want to use. The order will be respected.</span><br />
<span class="sc-1"> &nbsp; &nbsp;--&gt;</span><br />
&nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;panels<span class="re2">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;panel</span> <span class="re0">classname</span>=<span class="st0">&quot;HelloPanel&quot;</span><span class="re2">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;panel</span> <span class="re0">classname</span>=<span class="st0">&quot;LicencePanel&quot;</span><span class="re2">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;panel</span> <span class="re0">classname</span>=<span class="st0">&quot;TargetPanel&quot;</span><span class="re2">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;panel</span> <span class="re0">classname</span>=<span class="st0">&quot;PacksPanel&quot;</span><span class="re2">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;panel</span> <span class="re0">classname</span>=<span class="st0">&quot;InstallPanel&quot;</span><span class="re2">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;panel</span> <span class="re0">classname</span>=<span class="st0">&quot;ShortcutPanel&quot;</span><span class="re2">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;panel</span> <span class="re0">classname</span>=<span class="st0">&quot;FinishPanel&quot;</span><span class="re2">/&gt;</span></span><br />
&nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;/panels<span class="re2">&gt;</span></span></span><br />
<br />
&nbsp; &nbsp; <span class="sc-1">&lt;!-- </span><br />
<span class="sc-1"> &nbsp; &nbsp; &nbsp; &nbsp;The packs section.</span><br />
<span class="sc-1"> &nbsp; &nbsp; &nbsp; &nbsp;We specify here our packs.</span><br />
<span class="sc-1"> &nbsp; &nbsp;--&gt;</span><br />
&nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;packs<span class="re2">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;pack</span> <span class="re0">name</span>=<span class="st0">&quot;Base&quot;</span> <span class="re0">required</span>=<span class="st0">&quot;yes&quot;</span><span class="re2">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;description<span class="re2">&gt;</span></span></span>The base files<span class="sc3"><span class="re1">&lt;/description<span class="re2">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;file</span> <span class="re0">src</span>=<span class="st0">&quot;Readme.txt&quot;</span> <span class="re0">targetdir</span>=<span class="st0">&quot;$INSTALL_PATH&quot;</span><span class="re2">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;file</span> <span class="re0">src</span>=<span class="st0">&quot;Licence.txt&quot;</span> <span class="re0">targetdir</span>=<span class="st0">&quot;$INSTALL_PATH&quot;</span><span class="re2">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;file</span> <span class="re0">src</span>=<span class="st0">&quot;exe.ico&quot;</span> <span class="re0">targetdir</span>=<span class="st0">&quot;$INSTALL_PATH&quot;</span><span class="re2">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;file</span> <span class="re0">src</span>=<span class="st0">&quot;SoftwarePassionHelloIzPack.jar&quot;</span> <span class="re0">targetdir</span>=<span class="st0">&quot;$INSTALL_PATH&quot;</span><span class="re2">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;fileset</span> <span class="re0">dir</span>=<span class="st0">&quot;lib&quot;</span> <span class="re0">targetdir</span>=<span class="st0">&quot;$INSTALL_PATH\lib&quot;</span><span class="re2">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;include</span> <span class="re0">name</span>=<span class="st0">&quot;**&quot;</span><span class="re2">/&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;/fileset<span class="re2">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;/pack<span class="re2">&gt;</span></span></span><br />
&nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;/packs<span class="re2">&gt;</span></span></span><br />
&nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;native</span> <span class="re0">type</span>=<span class="st0">&quot;izpack&quot;</span> <span class="re0">name</span>=<span class="st0">&quot;ShellLink.dll&quot;</span><span class="re2">/&gt;</span></span><br />
&nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;native</span> <span class="re0">type</span>=<span class="st0">&quot;3rdparty&quot;</span> <span class="re0">name</span>=<span class="st0">&quot;COIOSHelper.dll&quot;</span> <span class="re0">stage</span>=<span class="st0">&quot;both&quot;</span><span class="re2">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;os</span> <span class="re0">family</span>=<span class="st0">&quot;windows&quot;</span><span class="re2">/&gt;</span></span><br />
&nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;/native<span class="re2">&gt;</span></span></span><br />
<span class="sc3"><span class="re1">&lt;/installation<span class="re2">&gt;</span></span></span></div></div>
<p>And the one for windows shortcuts:</p>
<div class="codecolorer-container xml " style="overflow:auto;white-space:nowrap;width:535px;height:300px"><div class="xml codecolorer" style="font-family:Monaco,Lucida Console,monospace"><span class="sc3"><span class="re1">&lt;?xml</span> <span class="re0">version</span>=<span class="st0">&quot;1.0&quot;</span> <span class="re0">encoding</span>=<span class="st0">&quot;UTF-8&quot;</span> <span class="re0">standalone</span>=<span class="st0">&quot;yes&quot;</span> <span class="re2">?&gt;</span></span><br />
<br />
<span class="sc3"><span class="re1">&lt;shortcuts<span class="re2">&gt;</span></span></span><br />
<br />
&nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;skipIfNotSupported</span><span class="re2">/&gt;</span></span><br />
<br />
&nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;programGroup</span> <span class="re0">defaultName</span>=<span class="st0">&quot;Siemens AWORT&quot;</span> <span class="re0">location</span>=<span class="st0">&quot;applications&quot;</span><span class="re2">/&gt;</span></span><br />
<br />
&nbsp; &nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;shortcut</span></span><br />
<span class="sc3"> &nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">name</span>=<span class="st0">&quot;SoftwarePassion Application&quot;</span></span><br />
<span class="sc3"> &nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">programGroup</span>=<span class="st0">&quot;yes&quot;</span></span><br />
<span class="sc3"> &nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">desktop</span>=<span class="st0">&quot;yes&quot;</span></span><br />
<span class="sc3"> &nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">applications</span>=<span class="st0">&quot;no&quot;</span></span><br />
<span class="sc3"> &nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">startMenu</span>=<span class="st0">&quot;yes&quot;</span></span><br />
<span class="sc3"> &nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">startup</span>=<span class="st0">&quot;no&quot;</span></span><br />
<span class="sc3"> &nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">target</span>=<span class="st0">&quot;$INSTALL_PATH\SoftwarePassionHelloIzPack.jar&quot;</span></span><br />
<span class="sc3"> &nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">commandLine</span>=<span class="st0">&quot;&quot;</span></span><br />
<span class="sc3"> &nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">description</span>=<span class="st0">&quot;Software Passion Example App&quot;</span></span><br />
<span class="sc3"> &nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">iconFile</span>=<span class="st0">&quot;$INSTALL_PATH\exe.ico&quot;</span></span><br />
<span class="sc3"> &nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">iconIndex</span>=<span class="st0">&quot;0&quot;</span></span><br />
<span class="sc3"> &nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">initialState</span>=<span class="st0">&quot;noShow&quot;</span><span class="re2">&gt;</span></span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class="sc3"><span class="re1">&lt;createForPack</span> <span class="re0">name</span>=<span class="st0">&quot;Base&quot;</span><span class="re2">/&gt;</span></span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp;<span class="sc3"><span class="re1">&lt;/shortcut<span class="re2">&gt;</span></span></span><br />
&nbsp;<br />
<br />
&nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;shortcut</span></span><br />
<span class="sc3"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class="re0">name</span>=<span class="st0">&quot;Software Passion Example App Uninstaller&quot;</span></span><br />
<span class="sc3"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class="re0">programGroup</span>=<span class="st0">&quot;yes&quot;</span></span><br />
<span class="sc3"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class="re0">desktop</span>=<span class="st0">&quot;no&quot;</span></span><br />
<span class="sc3"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class="re0">applications</span>=<span class="st0">&quot;no&quot;</span></span><br />
<span class="sc3"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class="re0">startMenu</span>=<span class="st0">&quot;no&quot;</span></span><br />
<span class="sc3"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class="re0">startup</span>=<span class="st0">&quot;no&quot;</span></span><br />
<span class="sc3"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class="re0">target</span>=<span class="st0">&quot;$INSTALL_PATH\Uninstaller\uninstaller.jar&quot;</span></span><br />
<span class="sc3"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class="re0">commandLine</span>=<span class="st0">&quot;&quot;</span></span><br />
<span class="sc3"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class="re0">iconFile</span>=<span class="st0">&quot;%SystemRoot%\system32\SHELL32.dll&quot;</span></span><br />
<span class="sc3"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class="re0">iconIndex</span>=<span class="st0">&quot;31&quot;</span></span><br />
<span class="sc3"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class="re0">description</span>=<span class="st0">&quot;Uninstall SoftwarePassion Example&quot;</span><span class="re2">&gt;</span></span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;createForPack</span> <span class="re0">name</span>=<span class="st0">&quot;Base&quot;</span><span class="re2">/&gt;</span></span><br />
&nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;/shortcut<span class="re2">&gt;</span></span></span><br />
<br />
<span class="sc3"><span class="re1">&lt;/shortcuts<span class="re2">&gt;</span></span></span></div></div>
<p>8. Example installation script contains both Readme.txt and Licence.txt which you can add to your &#8217;softwarepassion&#8217; folder.<br />
9. Once you have it all in one place, you should have a structure like in the following screenshot:</p>
<p><a href="http://softwarepassion.s3.amazonaws.com/wp-content/uploads/izpack_directory.png" rel="lightbox[341]"><img src="http://softwarepassion.s3.amazonaws.com/wp-content/uploads/izpack_directory-300x168.png" alt="izpack_directory" title="izpack_directory" width="300" height="168" class="aligncenter size-medium wp-image-342" /></a></p>
<p>10. Now assuming that your &#8217;softwarepassion&#8217; folder has been placed directly on the c: drive, execute the following command:</p>
<div class="codecolorer-container bash " style="overflow:auto;white-space:nowrap;width:535px"><div class="bash codecolorer" style="font-family:Monaco,Lucida Console,monospace">C:\Program Files\IzPack\bin<span class="sy0">&gt;</span>compile c:\softwarepassion\install.xml <span class="re5">-b</span> c:\softwarepassion</div></div>
<p>Assuming that IzPack itself was installed at: C:\Program Files\IzPack</p>
<p>This will produce install.jar file which is your installer.</p>
<p>11. If you dont&#8217; want your end users to click on the &#8216;jar&#8217; file as not everybody knows they can do that, you can add Izpack launcher app which will launch it automatically, or use another tool to create an executable called launch4j</p>
<p>You have to admit that it was an easy one!!!!!</p>
<p>Happy Installing!<br />
<script type="text/javascript"><!--
google_ad_client = "pub-3015706834207881";
/* 468x15, utworzono 09-11-19 */
google_ad_slot = "3912330401";
google_ad_width = 468;
google_ad_height = 15;
//-->
</script><br />
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script><br />
Download example files from <a href="http://www.softwarepassion.com/softwarepassion.zip">here</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.softwarepassion.com/deploy-your-java-application-with-izpack-installer/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Add &#8216;count #&#8217; column to JTable</title>
		<link>http://www.softwarepassion.com/add-count-column-to-jtable/</link>
		<comments>http://www.softwarepassion.com/add-count-column-to-jtable/#comments</comments>
		<pubDate>Fri, 05 Feb 2010 14:18:52 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Code Snippets]]></category>
		<category><![CDATA[General Programming]]></category>
		<category><![CDATA[Graphics And Design]]></category>
		<category><![CDATA[Learning Materials]]></category>
		<category><![CDATA[count column]]></category>
		<category><![CDATA[jxtable]]></category>

		<guid isPermaLink="false">http://www.softwarepassion.com/?p=336</guid>
		<description><![CDATA[<span style="max-width: 100px; display: block; float: left;"><img src="http://softwarepassion.s3.amazonaws.com/wp-content/uploads/count_jtable_column-300x179.png" alt="jtable count column" title="jtable # column" width="100" height="100"/></span><span style="margin: 0px; padding-left: 10px; display: block; max-width: 370px; float: left;">How to add 'count#' column in JTable</span>]]></description>
			<content:encoded><![CDATA[<p>Important note first: This is mostly not my code, I was strugling with this problem for some time, I couldn&#8217;t google it at all, and one day, I&#8217;ve just found it. Now I use it in one of my projects but I cannot find the original post again, therefore I have decided to post it on my blog (slightly modified version of the original) so other people with similar problem will have a better chance of finding the solution.<br />
So, the idea is very simple. The whole point of displaying additional column which is kind of independent from the other columns is to simply use another table. This way you can sort one table by column and the number column will not sort with it. &#8211; thats exactly what I was looking for and I guess its kind of popular problem.<br />
Becouse you put two tables in one scroll pane the gui looks like its just one column!<br />
<script type="text/javascript"><!--
google_ad_client = "pub-3015706834207881";
/* 468x15, utworzono 09-11-19 */
google_ad_slot = "3912330401";
google_ad_width = 468;
google_ad_height = 15;
//-->
</script><br />
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script><br />
I have created one simple method to apply this technique to any tables in my application (I use JXTable actually but JTable will do as well)</p>
<div class="codecolorer-container java " style="overflow:auto;white-space:nowrap;width:535px"><div class="java codecolorer" style="font-family:Monaco,Lucida Console,monospace"><span class="kw1">private</span> <span class="kw4">void</span> addLPColumn<span class="br0">&#40;</span>JXTable table, <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Ajscrollpane+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span class="kw3">JScrollPane</span></a> scp<span class="br0">&#41;</span><span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Ajtable+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span class="kw3">JTable</span></a> rowTable <span class="sy0">=</span> <span class="kw1">new</span> RowNumberTable<span class="br0">&#40;</span>table<span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; scp.<span class="me1">setRowHeaderView</span><span class="br0">&#40;</span>rowTable<span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; scp.<span class="me1">setCorner</span><span class="br0">&#40;</span><a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Ajscrollpane+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span class="kw3">JScrollPane</span></a>.<span class="me1">UPPER_LEFT_CORNER</span>, rowTable.<span class="me1">getTableHeader</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; scp.<span class="me1">repaint</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; <span class="br0">&#125;</span></div></div>
<p><script type="text/javascript"><!--
google_ad_client = "pub-3015706834207881";
/* 468x15, utworzono 09-11-19 */
google_ad_slot = "3912330401";
google_ad_width = 468;
google_ad_height = 15;
//-->
</script><br />
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
<p>RowNumberTable is simple one column table displaying the &#8216;count&#8217; number of rows in the second table. </p>
<p><script type="text/javascript"><!--
google_ad_client = "pub-3015706834207881";
/* 468x15, utworzono 09-11-19 */
google_ad_slot = "3912330401";
google_ad_width = 468;
google_ad_height = 15;
//-->
</script><br />
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
<div class="codecolorer-container java " style="overflow:auto;white-space:nowrap;width:535px;height:300px"><div class="java codecolorer" style="font-family:Monaco,Lucida Console,monospace"><span class="kw1">public</span> <span class="kw1">class</span> RowNumberTable <span class="kw1">extends</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Ajtable+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span class="kw3">JTable</span></a><br />
&nbsp; &nbsp; <span class="kw1">implements</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Achangelistener+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span class="kw3">ChangeListener</span></a>, <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Apropertychangelistener+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span class="kw3">PropertyChangeListener</span></a><br />
<span class="br0">&#123;</span><br />
&nbsp; &nbsp; <span class="kw1">private</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Ajtable+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span class="kw3">JTable</span></a> main<span class="sy0">;</span><br />
<br />
&nbsp; &nbsp; <span class="kw1">public</span> RowNumberTable<span class="br0">&#40;</span><a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Ajtable+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span class="kw3">JTable</span></a> table<span class="br0">&#41;</span><br />
&nbsp; &nbsp; <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; main <span class="sy0">=</span> table<span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; main.<span class="me1">addPropertyChangeListener</span><span class="br0">&#40;</span> <span class="kw1">this</span> <span class="br0">&#41;</span><span class="sy0">;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; setFocusable<span class="br0">&#40;</span> <span class="kw2">false</span> <span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; setAutoCreateColumnsFromModel<span class="br0">&#40;</span> <span class="kw2">false</span> <span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; setModel<span class="br0">&#40;</span> main.<span class="me1">getModel</span><span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; setSelectionModel<span class="br0">&#40;</span> main.<span class="me1">getSelectionModel</span><span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="br0">&#41;</span><span class="sy0">;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Atablecolumn+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span class="kw3">TableColumn</span></a> column <span class="sy0">=</span> <span class="kw1">new</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Atablecolumn+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span class="kw3">TableColumn</span></a><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; column.<span class="me1">setHeaderValue</span><span class="br0">&#40;</span><span class="st0">&quot;Lp.&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; addColumn<span class="br0">&#40;</span> column <span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; column.<span class="me1">setCellRenderer</span><span class="br0">&#40;</span><span class="kw1">new</span> RowNumberRenderer<span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; getColumnModel<span class="br0">&#40;</span><span class="br0">&#41;</span>.<span class="me1">getColumn</span><span class="br0">&#40;</span><span class="nu0">0</span><span class="br0">&#41;</span>.<span class="me1">setPreferredWidth</span><span class="br0">&#40;</span><span class="nu0">40</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; setPreferredScrollableViewportSize<span class="br0">&#40;</span>getPreferredSize<span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; <span class="br0">&#125;</span><br />
<br />
&nbsp; &nbsp; @Override<br />
&nbsp; &nbsp; <span class="kw1">public</span> <span class="kw4">void</span> addNotify<span class="br0">&#40;</span><span class="br0">&#41;</span><br />
&nbsp; &nbsp; <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">super</span>.<span class="me1">addNotify</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Acomponent+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span class="kw3">Component</span></a> c <span class="sy0">=</span> getParent<span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">// &nbsp;Keep scrolling of the row table in sync with the main table.</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">if</span> <span class="br0">&#40;</span>c <span class="kw1">instanceof</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Ajviewport+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span class="kw3">JViewport</span></a><span class="br0">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Ajviewport+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span class="kw3">JViewport</span></a> viewport <span class="sy0">=</span> <span class="br0">&#40;</span><a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Ajviewport+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span class="kw3">JViewport</span></a><span class="br0">&#41;</span>c<span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; viewport.<span class="me1">addChangeListener</span><span class="br0">&#40;</span> <span class="kw1">this</span> <span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; <span class="br0">&#125;</span><br />
<br />
&nbsp; &nbsp; <span class="coMULTI">/*<br />
&nbsp; &nbsp; &nbsp;* &nbsp;Delegate method to main table<br />
&nbsp; &nbsp; &nbsp;*/</span><br />
&nbsp; &nbsp; @Override<br />
&nbsp; &nbsp; <span class="kw1">public</span> <span class="kw4">int</span> getRowCount<span class="br0">&#40;</span><span class="br0">&#41;</span><br />
&nbsp; &nbsp; <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">if</span><span class="br0">&#40;</span>main <span class="sy0">!=</span> <span class="kw2">null</span><span class="br0">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">return</span> main.<span class="me1">getRowCount</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">else</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">return</span> <span class="nu0">0</span><span class="sy0">;</span><br />
&nbsp; &nbsp; <span class="br0">&#125;</span><br />
<br />
&nbsp; &nbsp; @Override<br />
&nbsp; &nbsp; <span class="kw1">public</span> <span class="kw4">int</span> getRowHeight<span class="br0">&#40;</span><span class="kw4">int</span> row<span class="br0">&#41;</span><br />
&nbsp; &nbsp; <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">return</span> main.<span class="me1">getRowHeight</span><span class="br0">&#40;</span>row<span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; <span class="br0">&#125;</span><br />
<br />
&nbsp; &nbsp; <span class="coMULTI">/*<br />
&nbsp; &nbsp; &nbsp;* &nbsp;This table does not use any data from the main TableModel,<br />
&nbsp; &nbsp; &nbsp;* &nbsp;so just return a value based on the row parameter.<br />
&nbsp; &nbsp; &nbsp;*/</span><br />
&nbsp; &nbsp; @Override<br />
&nbsp; &nbsp; <span class="kw1">public</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Aobject+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span class="kw3">Object</span></a> getValueAt<span class="br0">&#40;</span><span class="kw4">int</span> row, <span class="kw4">int</span> column<span class="br0">&#41;</span><br />
&nbsp; &nbsp; <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">return</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Ainteger+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span class="kw3">Integer</span></a>.<span class="me1">toString</span><span class="br0">&#40;</span>row <span class="sy0">+</span> <span class="nu0">1</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; <span class="br0">&#125;</span><br />
<br />
&nbsp; &nbsp; <span class="coMULTI">/*<br />
&nbsp; &nbsp; &nbsp;* &nbsp;Don't edit data in the main TableModel by mistake<br />
&nbsp; &nbsp; &nbsp;*/</span><br />
&nbsp; &nbsp; @Override<br />
&nbsp; &nbsp; <span class="kw1">public</span> <span class="kw4">boolean</span> isCellEditable<span class="br0">&#40;</span><span class="kw4">int</span> row, <span class="kw4">int</span> column<span class="br0">&#41;</span><br />
&nbsp; &nbsp; <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">return</span> <span class="kw2">false</span><span class="sy0">;</span><br />
&nbsp; &nbsp; <span class="br0">&#125;</span><br />
<span class="co1">//</span><br />
<span class="co1">// &nbsp;Implement the ChangeListener</span><br />
<span class="co1">//</span><br />
&nbsp; &nbsp; <span class="kw1">public</span> <span class="kw4">void</span> stateChanged<span class="br0">&#40;</span><a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Achangeevent+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span class="kw3">ChangeEvent</span></a> e<span class="br0">&#41;</span><br />
&nbsp; &nbsp; <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">// &nbsp;Keep the scrolling of the row table in sync with main table</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Ajviewport+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span class="kw3">JViewport</span></a> viewport <span class="sy0">=</span> <span class="br0">&#40;</span><a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Ajviewport+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span class="kw3">JViewport</span></a><span class="br0">&#41;</span> e.<span class="me1">getSource</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Ajscrollpane+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span class="kw3">JScrollPane</span></a> scrollPane <span class="sy0">=</span> <span class="br0">&#40;</span><a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Ajscrollpane+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span class="kw3">JScrollPane</span></a><span class="br0">&#41;</span>viewport.<span class="me1">getParent</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; scrollPane.<span class="me1">getVerticalScrollBar</span><span class="br0">&#40;</span><span class="br0">&#41;</span>.<span class="me1">setValue</span><span class="br0">&#40;</span>viewport.<span class="me1">getViewPosition</span><span class="br0">&#40;</span><span class="br0">&#41;</span>.<span class="me1">y</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; <span class="br0">&#125;</span><br />
<span class="co1">//</span><br />
<span class="co1">// &nbsp;Implement the PropertyChangeListener</span><br />
<span class="co1">//</span><br />
&nbsp; &nbsp; <span class="kw1">public</span> <span class="kw4">void</span> propertyChange<span class="br0">&#40;</span><a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Apropertychangeevent+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span class="kw3">PropertyChangeEvent</span></a> e<span class="br0">&#41;</span><br />
&nbsp; &nbsp; <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">// &nbsp;Keep the row table in sync with the main table</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">if</span> <span class="br0">&#40;</span><span class="st0">&quot;selectionModel&quot;</span>.<span class="me1">equals</span><span class="br0">&#40;</span>e.<span class="me1">getPropertyName</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#41;</span><span class="br0">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; setSelectionModel<span class="br0">&#40;</span> main.<span class="me1">getSelectionModel</span><span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">if</span> <span class="br0">&#40;</span><span class="st0">&quot;model&quot;</span>.<span class="me1">equals</span><span class="br0">&#40;</span>e.<span class="me1">getPropertyName</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#41;</span><span class="br0">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; setModel<span class="br0">&#40;</span> main.<span class="me1">getModel</span><span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; <span class="br0">&#125;</span><br />
<br />
&nbsp; &nbsp; <span class="coMULTI">/*<br />
&nbsp; &nbsp; &nbsp;* &nbsp;Borrow the renderer from JDK1.4.2 table header<br />
&nbsp; &nbsp; &nbsp;*/</span><br />
&nbsp; &nbsp; <span class="kw1">private</span> <span class="kw1">static</span> <span class="kw1">class</span> RowNumberRenderer <span class="kw1">extends</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Adefaulttablecellrenderer+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span class="kw3">DefaultTableCellRenderer</span></a><br />
&nbsp; &nbsp; <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">public</span> RowNumberRenderer<span class="br0">&#40;</span><span class="br0">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; setHorizontalAlignment<span class="br0">&#40;</span><a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Ajlabel+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span class="kw3">JLabel</span></a>.<span class="me1">CENTER</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">public</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Acomponent+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span class="kw3">Component</span></a> getTableCellRendererComponent<span class="br0">&#40;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Ajtable+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span class="kw3">JTable</span></a> table, <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Aobject+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span class="kw3">Object</span></a> value, <span class="kw4">boolean</span> isSelected, <span class="kw4">boolean</span> hasFocus, <span class="kw4">int</span> row, <span class="kw4">int</span> column<span class="br0">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">if</span> <span class="br0">&#40;</span>table <span class="sy0">!=</span> <span class="kw2">null</span><span class="br0">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Ajtableheader+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span class="kw3">JTableHeader</span></a> header <span class="sy0">=</span> table.<span class="me1">getTableHeader</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">if</span> <span class="br0">&#40;</span>header <span class="sy0">!=</span> <span class="kw2">null</span><span class="br0">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; setForeground<span class="br0">&#40;</span>header.<span class="me1">getForeground</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; setBackground<span class="br0">&#40;</span>header.<span class="me1">getBackground</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; setFont<span class="br0">&#40;</span>header.<span class="me1">getFont</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">if</span> <span class="br0">&#40;</span>isSelected<span class="br0">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; setFont<span class="br0">&#40;</span> getFont<span class="br0">&#40;</span><span class="br0">&#41;</span>.<span class="me1">deriveFont</span><span class="br0">&#40;</span><a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Afont+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span class="kw3">Font</span></a>.<span class="me1">BOLD</span><span class="br0">&#41;</span> <span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; setText<span class="br0">&#40;</span><span class="br0">&#40;</span>value <span class="sy0">==</span> <span class="kw2">null</span><span class="br0">&#41;</span> <span class="sy0">?</span> <span class="st0">&quot;&quot;</span> <span class="sy0">:</span> value.<span class="me1">toString</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; setBorder<span class="br0">&#40;</span><a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Auimanager+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span class="kw3">UIManager</span></a>.<span class="me1">getBorder</span><span class="br0">&#40;</span><span class="st0">&quot;TableHeader.cellBorder&quot;</span><span class="br0">&#41;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">return</span> <span class="kw1">this</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; <span class="br0">&#125;</span><br />
<span class="br0">&#125;</span></div></div>
<p><a href="http://softwarepassion.s3.amazonaws.com/wp-content/uploads/count_jtable_column.png" rel="lightbox[336]"><img src="http://softwarepassion.s3.amazonaws.com/wp-content/uploads/count_jtable_column-300x179.png" alt="count_jtable_column" title="count_jtable_column" width="300" height="179" class="aligncenter size-medium wp-image-337" /></a></p>
<p>In my case the &#8216;count&#8217; column is called &#8216;Lp.&#8217; &#8211; in polish </p>
<p><script type="text/javascript"><!--
google_ad_client = "pub-3015706834207881";
/* 468x15, utworzono 09-11-19 */
google_ad_slot = "3912330401";
google_ad_width = 468;
google_ad_height = 15;
//-->
</script><br />
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script><br />
I have created one simple method to apply this technique to any tables in my application (I use JXTable actually but JTable will do as well)</p>
<div class="codecolorer-container java " style="overflow:auto;white-space:nowrap;width:535px"><div class="java codecolorer" style="font-family:Monaco,Lucida Console,monospace"><span class="kw1">private</span> <span class="kw4">void</span> addLPColumn<span class="br0">&#40;</span>JXTable table, <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Ajscrollpane+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span class="kw3">JScrollPane</span></a> scp<span class="br0">&#41;</span><span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Ajtable+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span class="kw3">JTable</span></a> rowTable <span class="sy0">=</span> <span class="kw1">new</span> RowNumberTable<span class="br0">&#40;</span>table<span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; scp.<span class="me1">setRowHeaderView</span><span class="br0">&#40;</span>rowTable<span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; scp.<span class="me1">setCorner</span><span class="br0">&#40;</span><a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Ajscrollpane+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span class="kw3">JScrollPane</span></a>.<span class="me1">UPPER_LEFT_CORNER</span>, rowTable.<span class="me1">getTableHeader</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; scp.<span class="me1">repaint</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; <span class="br0">&#125;</span></div></div>
<p><script type="text/javascript"><!--
google_ad_client = "pub-3015706834207881";
/* 468x15, utworzono 09-11-19 */
google_ad_slot = "3912330401";
google_ad_width = 468;
google_ad_height = 15;
//-->
</script><br />
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
]]></content:encoded>
			<wfw:commentRss>http://www.softwarepassion.com/add-count-column-to-jtable/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>JXTable and primary key &#8211; how to.</title>
		<link>http://www.softwarepassion.com/jxtable-and-primary-key-how-to/</link>
		<comments>http://www.softwarepassion.com/jxtable-and-primary-key-how-to/#comments</comments>
		<pubDate>Mon, 07 Dec 2009 11:42:47 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[General Programming]]></category>
		<category><![CDATA[jxtable]]></category>
		<category><![CDATA[primary key]]></category>
		<category><![CDATA[swing]]></category>
		<category><![CDATA[swinglabs]]></category>

		<guid isPermaLink="false">http://www.softwarepassion.com/?p=328</guid>
		<description><![CDATA[<span style="max-width: 100px; display: block; float: left;"><img src="http://softwarepassion.s3.amazonaws.com/wp-content/uploads/swinglabs-150x116.png" alt="jxtable and primary key" title="jxtable" width="100" height="100"/></span><span style="margin: 0px; padding-left: 10px; display: block; max-width: 370px; float: left;">This is a short tutorial on how to get the primary key of the object displayed as JXTable row.</span>]]></description>
			<content:encoded><![CDATA[<p><a href="http://softwarepassion.s3.amazonaws.com/wp-content/uploads/swinglabs.png" rel="lightbox[328]"><img src="http://softwarepassion.s3.amazonaws.com/wp-content/uploads/swinglabs-150x116.png" alt="swinglabs" title="swinglabs" width="150" height="116" class="alignleft size-thumbnail wp-image-330" /></a><br />
Today I will describe in a few words and a couple lines of code how to get the id of the row in JXTable. When working with data coming from database we don&#8217;t really want to display the primary key of the object but to hide it. This can cause a small problem once we want to find out for example which item was clicked, ok we can easily find out which row it was but its not always easy to find out which actual object it was especially when using JXTable sorting capabilities.<br />
The whole trick is to get the the corresponding object from the model and not from the view.<br />
Here is a short code snippet to do just that, hope that helps everyone who uses great JXTable component to display some data.<br />
<script type="text/javascript"><!--
google_ad_client = "pub-3015706834207881";
/* 468x15, utworzono 09-11-19 */
google_ad_slot = "3912330401";
google_ad_width = 468;
google_ad_height = 15;
//-->
</script><br />
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
<div class="codecolorer-container java " style="overflow:auto;white-space:nowrap;width:535px"><div class="java codecolorer" style="font-family:Monaco,Lucida Console,monospace"><span class="kw1">private</span> <span class="kw4">int</span> getObjectID<span class="br0">&#40;</span>JXTable table<span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw4">int</span> rowx <span class="sy0">=</span> table.<span class="me1">getSelectedRow</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw4">int</span> resultx <span class="sy0">=</span> <span class="nu0">0</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">if</span> <span class="br0">&#40;</span>rowx <span class="sy0">&lt;</span> <span class="nu0">0</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">return</span> <span class="nu0">0</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; resultx <span class="sy0">=</span> table.<span class="me1">convertRowIndexToModel</span><span class="br0">&#40;</span>rowx<span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw4">int</span> id <span class="sy0">=</span> <span class="br0">&#40;</span><a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Ainteger+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span class="kw3">Integer</span></a><span class="br0">&#41;</span> table.<span class="me1">getModel</span><span class="br0">&#40;</span><span class="br0">&#41;</span>.<span class="me1">getValueAt</span><span class="br0">&#40;</span>resultx, <span class="nu0">0</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">return</span> id<span class="sy0">;</span><br />
&nbsp; &nbsp; <span class="br0">&#125;</span></div></div>
<p>This works of course assuming that your object index is set as first column in your model (position 0).<br />
<script type="text/javascript"><!--
google_ad_client = "pub-3015706834207881";
/* 468x15, utworzono 09-11-19 */
google_ad_slot = "3912330401";
google_ad_width = 468;
google_ad_height = 15;
//-->
</script><br />
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
]]></content:encoded>
			<wfw:commentRss>http://www.softwarepassion.com/jxtable-and-primary-key-how-to/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Small Web Design Inspiration Set</title>
		<link>http://www.softwarepassion.com/small-web-design-inspiration-set/</link>
		<comments>http://www.softwarepassion.com/small-web-design-inspiration-set/#comments</comments>
		<pubDate>Tue, 01 Dec 2009 17:09:20 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Graphics And Design]]></category>
		<category><![CDATA[inspiration]]></category>
		<category><![CDATA[web design]]></category>

		<guid isPermaLink="false">http://www.softwarepassion.com/?p=322</guid>
		<description><![CDATA[<span style="max-width: 100px; display: block; float: left;"><img src="http://softwarepassion.s3.amazonaws.com/wp-content/uploads/flickr.png" alt="jquery" title="amazon rds" width="100" height="100" class="size-thumbnail wp-image-278" /></span><span style="margin: 0px; padding-left: 10px; display: block; max-width: 370px; float: left;">Small Web Design Inspiration Set</span> 
]]></description>
			<content:encoded><![CDATA[<p><a href="http://softwarepassion.s3.amazonaws.com/wp-content/uploads/flickr.png" rel="lightbox[322]"><img src="http://softwarepassion.s3.amazonaws.com/wp-content/uploads/flickr.png" alt="flickr" title="flickr" width="150" height="150" class="alignleft size-full wp-image-323" /></a><br />
This is a small set of links I&#8217;ve found pointing to some collections of web page screenshots which you can use for your web design inspiration. I have found it very usefull and I hope you will find it usefull too. If you know some more which are not listed here please share using comments section.<br />
<script type="text/javascript"><!--
google_ad_client = "pub-3015706834207881";
/* 468x15, utworzono 09-11-19 */
google_ad_slot = "3912330401";
google_ad_width = 468;
google_ad_height = 15;
//-->
</script><br />
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
<ol>
<li><a href="http://www.flickr.com/photos/splat/collections/72157600060481506/">Patrick Haney</a></li>
<li><a href="http://www.flickr.com/groups/webdesign-inspiration/">Patrick Haney&#8217;s Group Pool</a></li>
<li><a href="http://www.flickr.com/photos/elliotjaystocks/sets/72157608330947031/">Design inspiration via LittleSnapper by Elliot</a></li>
<li><a href="http://www.flickr.com/photos/factoryjoe/collections/72157600001823120/">Web Design Patterns by FactoryJoe</a></li>
<li><a href="http://vandelaydesign.com/blog/galleries/inspiration/">50 Websites (and More) for Your Design Inspiration from Vandelay Design</a></li>
<li><a href="http://designm.ag/inspiration/portfolio-sites-2/">30 More Portfolio Sites for Your Design Inspiration from Designm.ag</a></li>
<li><a href="http://dzineblog.com/2008/12/interface-design-inspiration-36-clean-comment-form-designs.html">Interface Design Inspiration &#8211; 36 Clean Comment Form designs</a></li>
<li><a href="http://designm.ag/inspiration/textured-websites/">40 Textured Websites for Design Inspiration from Designm.ag</a></li>
</ol>
<p>Have fun!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.softwarepassion.com/small-web-design-inspiration-set/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>15+22 jQuery Image Slideshow/Slider Tutorials and Plugins for Your Next Projects</title>
		<link>http://www.softwarepassion.com/1522-jquery-image-slideshowslider-tutorials-and-plugins-for-your-next-projects/</link>
		<comments>http://www.softwarepassion.com/1522-jquery-image-slideshowslider-tutorials-and-plugins-for-your-next-projects/#comments</comments>
		<pubDate>Tue, 01 Dec 2009 16:45:12 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Graphics And Design]]></category>
		<category><![CDATA[Java Script]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[galleries]]></category>
		<category><![CDATA[jquery]]></category>

		<guid isPermaLink="false">http://www.softwarepassion.com/?p=320</guid>
		<description><![CDATA[<span style="max-width: 100px; display: block; float: left;"><img src="http://softwarepassion.s3.amazonaws.com/wp-content/uploads/jquery_slideshows23.jpg" alt="jquery" title="amazon rds" width="100" height="100" class="size-thumbnail wp-image-278" /></span><span style="margin: 0px; padding-left: 10px; display: block; max-width: 370px; float: left;">15+22 jQuery Image Slideshow/Slider Tutorials and Plugins for Your Next Projects</span> 
]]></description>
			<content:encoded><![CDATA[<p><a href="http://softwarepassion.s3.amazonaws.com/wp-content/uploads/jquery_slideshows23.jpg" rel="lightbox[320]"><img src="http://softwarepassion.s3.amazonaws.com/wp-content/uploads/jquery_slideshows23-150x150.jpg" alt="jquery_slideshows23" title="jquery_slideshows23" width="150" height="150" class="alignleft size-thumbnail wp-image-319" /></a><br />
<script type="text/javascript"><!--
google_ad_client = "pub-3015706834207881";
/* 468x15, utworzono 09-11-19 */
google_ad_slot = "3912330401";
google_ad_width = 468;
google_ad_height = 15;
//-->
</script><br />
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script><br />
<a href="http://webanthology.net/1522-jquery-image-slideshowslider-tutorials-and-plugins-for-your-next-projects/2009/11/24/">15+22 jQuery Image Slideshow/Slider Tutorials and Plugins for Your Next Projects</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.softwarepassion.com/1522-jquery-image-slideshowslider-tutorials-and-plugins-for-your-next-projects/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Top 10 Things to Know About Amazon RDS</title>
		<link>http://www.softwarepassion.com/top-10-things-to-know-about-amazon-rds/</link>
		<comments>http://www.softwarepassion.com/top-10-things-to-know-about-amazon-rds/#comments</comments>
		<pubDate>Sun, 22 Nov 2009 12:56:08 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Cloud Computing]]></category>
		<category><![CDATA[amazon rds]]></category>

		<guid isPermaLink="false">http://www.softwarepassion.com/?p=316</guid>
		<description><![CDATA[<span style="max-width: 100px; display: block; float: left;"><img src="http://softwarepassion.s3.amazonaws.com/wp-content/uploads/amazon_rds_10_things_to_know-150x150.jpg" alt="jquery" title="amazon rds" width="100" height="100" class="size-thumbnail wp-image-278" /></span><span style="margin: 0px; padding-left: 10px; display: block; max-width: 370px; float: left;">Top 10 Things to Know About Amazon RDS</span> 
]]></description>
			<content:encoded><![CDATA[<p><a href="http://softwarepassion.s3.amazonaws.com/wp-content/uploads/amazon_rds_10_things_to_know.jpg" rel="lightbox[316]"><img src="http://softwarepassion.s3.amazonaws.com/wp-content/uploads/amazon_rds_10_things_to_know-150x150.jpg" alt="amazon_rds_10_things_to_know" title="amazon_rds_10_things_to_know" width="150" height="150" class="alignleft size-thumbnail wp-image-317" /></a><br />
Top 10 Things to Know About Amazon RDS<br />
<script type="text/javascript"><!--
google_ad_client = "pub-3015706834207881";
/* 468x15, utworzono 09-11-19 */
google_ad_slot = "3912330401";
google_ad_width = 468;
google_ad_height = 15;
//-->
</script><br />
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script><br />
<a href="http://www.webyog.com/blog/2009/11/16/top-10-things-to-know-about-amazon-rds/">Top 10 Things to Know About Amazon RDS</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.softwarepassion.com/top-10-things-to-know-about-amazon-rds/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
