<?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>Jappit.com &#187; calendar</title>
	<atom:link href="http://www.jappit.com/blog/tag/calendar/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.jappit.com/blog</link>
	<description>Mobile blog by Alessandro La Rosa</description>
	<lastBuildDate>Wed, 23 Nov 2011 10:38:23 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Gcal version 0.3: touch support, local events, and a bunch of fixes!</title>
		<link>http://www.jappit.com/blog/2009/02/16/gcal-version-03-touch-support-local-events-and-a-bunch-of-fixes/</link>
		<comments>http://www.jappit.com/blog/2009/02/16/gcal-version-03-touch-support-local-events-and-a-bunch-of-fixes/#comments</comments>
		<pubDate>Mon, 16 Feb 2009 14:44:22 +0000</pubDate>
		<dc:creator>pit</dc:creator>
				<category><![CDATA[cool stuff]]></category>
		<category><![CDATA[j2me]]></category>
		<category><![CDATA[mobile]]></category>
		<category><![CDATA[calendar]]></category>
		<category><![CDATA[google calendar mobile]]></category>
		<category><![CDATA[j2me google calendar]]></category>
		<category><![CDATA[java me]]></category>

		<guid isPermaLink="false">http://www.jappit.com/blog/?p=282</guid>
		<description><![CDATA[Version 0.3 of Gcal, the J2ME Google Calendar client, is finally out! Most of the work was done to improve device compatibility and fix bugs on specific handsets (e.g.: BlackBerry devices, Nokia E61, and many more). Release details New cool features are introduced: Touch-screen support: if you have a device supporting touch, now you can [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Version 0.3</strong> of <strong>Gcal, the J2ME Google Calendar client</strong>, is finally out!</p>
<p><img class="alignnone" title="Gcal on BlackBerry 9500" src="http://www.jappit.com/images/blog/uploads/gcal_blackberry_9500.jpg" alt="" width="450" height="280" /></p>
<p>Most of the work was done to <strong>improve device compatibility</strong> and <strong>fix bugs</strong> on specific handsets (e.g.: <strong>BlackBerry devices</strong>, <strong>Nokia E61</strong>, and many more).</p>
<p style="text-align: center;"><a title="Download J2ME Google Calendar" href="http://www.jappit.com/download_j2me_google_calendar.htm"><img class="aligncenter" title="Download Gcal" src="http://www.jappit.com/images/blog/uploads/GCal_download.png" alt="" width="198" height="69" /></a></p>
<h3>Release details</h3>
<p><strong>N</strong><strong>ew cool features</strong> are introduced:</p>
<ul>
<li><strong>Touch-screen support</strong>: if you have a device supporting touch, now you can easily interact with Gcal with stylus/fingers!<br />
<strong> Touch gestures</strong> are also implemented: go from a day to another simply swiping!</li>
<li><strong>Event saving on local calendar</strong>: you can now save an event on your local calendar. If you&#8217;re creating a new event, just check the <em>&#8220;Save on local calendar&#8221;</em> option. Instead, if you&#8217;re viewing a saved event, choose <em>&#8220;Actions&#8221; -&gt; &#8220;Save locally&#8221;</em> from the options menu.</li>
</ul>
<p><strong>New settings</strong> are also available:</p>
<ul>
<li><strong>Font size</strong>: introduced to improve readability, and to allow users with touch-screen to have larger touchable areas</li>
<li><strong>Alternative soft-keys</strong>: devices without hardware soft-keys can now use <strong>&#8216;*&#8217; and &#8216;#</strong>&#8216; <strong>keys</strong> to substitute them, and so use <strong>Gcal</strong> without any more problems</li>
<li><strong>Show only calendars with events</strong>: this will allow users with a lot of calendars to show only the ones actually selected in the &#8220;Filter calendars&#8221; screen, greatly improving events readability</li>
</ul>
<p>Among the <strong>fixed bugs</strong>:</p>
<ul>
<li><strong>Calendar loading errors</strong> on various handsets</li>
<li><strong>Filters scrolling and selection</strong> in calendar filtering screen</li>
<li><strong>Screen size/orientation changes</strong> are now better handled</li>
</ul>
<h3>Give your feedback</h3>
<p>A lot of <strong>new features are still under development</strong>, and surely a lot are the missing features that <strong>you would like to see</strong> into your Gcal. Just <strong>leave your comment here</strong>, and your feedback will be surely considered for the next Gcal releases!</p>]]></content:encoded>
			<wfw:commentRss>http://www.jappit.com/blog/2009/02/16/gcal-version-03-touch-support-local-events-and-a-bunch-of-fixes/feed/</wfw:commentRss>
		<slash:comments>53</slash:comments>
		</item>
		<item>
		<title>Gcal update: version 0.2 released!</title>
		<link>http://www.jappit.com/blog/2009/01/11/gcal-update-version-02-released/</link>
		<comments>http://www.jappit.com/blog/2009/01/11/gcal-update-version-02-released/#comments</comments>
		<pubDate>Sun, 11 Jan 2009 09:53:41 +0000</pubDate>
		<dc:creator>pit</dc:creator>
				<category><![CDATA[cool stuff]]></category>
		<category><![CDATA[j2me]]></category>
		<category><![CDATA[mobile]]></category>
		<category><![CDATA[calendar]]></category>
		<category><![CDATA[gcal]]></category>
		<category><![CDATA[gcal update]]></category>
		<category><![CDATA[google calendar]]></category>
		<category><![CDATA[google calendar mobile]]></category>
		<category><![CDATA[java me]]></category>

		<guid isPermaLink="false">http://www.jappit.com/blog/?p=209</guid>
		<description><![CDATA[NEW: check out the new Gcal 0.3 version! Holidays are gone, but gifts are not! So, here&#8217;s a big update to Gcal, the J2ME Google Calendar client: version 0.2 is available for download! Thanks to your precious support and feedback a lot of improvements and bug fixes have been done: thank you all (and please [...]]]></description>
			<content:encoded><![CDATA[<p><strong>NEW:</strong> check out the new <a title="J2ME Google Calendar" href="http://www.jappit.com/blog/2009/02/16/gcal-version-03-touch-support-local-events-and-a-bunch-of-fixes/">Gcal 0.3 version</a>!</p>
<p>Holidays are gone, but gifts are not! So, here&#8217;s a big update to <a title="J2ME Google Calendar" href="http://www.jappit.com/blog/2008/12/22/j2me-google-calendar-client/">Gcal, the J2ME Google Calendar client</a>: <strong>version 0.2 is available for download</strong>!</p>
<p style="text-align: center;"><a href="http://www.jappit.com/download_j2me_google_calendar.htm"><img class="aligncenter" title="Download J2ME Google Calendar" src="http://www.jappit.com/images/blog/uploads/GCal_download.png" alt="" width="198" height="69" /></a></p>
<p>Thanks to <strong>your precious support and feedback</strong> a lot of <strong>improvements</strong> and <strong>bug fixes</strong> have been done: <strong>thank you all</strong> (and please don&#8217;t stop <img src='http://www.jappit.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  )!</p>
<p><img class="alignnone" title="J2ME Google Calendar Nokia screenshots" src="http://www.jappit.com/images/blog/uploads/GCal_nokiaShots.jpg" alt="" width="430" height="235" /></p>
<p><strong>New features</strong> of this version include:</p>
<ul>
<li><strong>Check for updates</strong> and <strong>auto-update</strong> features: you can now manually check for updates, or switch on auto-updates (from Settings screen) to always get the latest Gcal releases!</li>
<li>More control over events: <strong>delete</strong>, <strong>duplicate</strong> and <strong>copy an event </strong>from a calendar to another in a snap!</li>
<li>Comments: It&#8217;s now possible to <strong>add and view comments</strong> for an event</li>
<li>More event details: event visibility (<strong>private/public</strong>) and <strong>available/busy </strong>status now available when creating an event</li>
<li>Map viewing: <strong>different types of maps</strong> have been added, so you can now switch among satellite/terrain and other views</li>
<li><strong>S</strong><strong>ending an event, with his details, via SMS</strong></li>
</ul>
<p>Important <strong>bugs fixed</strong> in this release:</p>
<ul>
<li><strong>Character encoding</strong>: terrible lack of first versions, character encoding should now correctly work</li>
<li><strong>Wrong time</strong> when creating/showing events, with some timezones</li>
<li><strong>Events order</strong> sometimes scrambled</li>
<li><strong>Wrong login error messages</strong>: now, different types of errors are correctly handled</li>
<li><strong>Calendars filter sometimes resetted</strong> without changing the account</li>
<li>Different types of <strong>errors and Exceptions when receiving events</strong> (e.g.: on Nokia S40 devices)</li>
</ul>
<p>Many other minor fixes have been done, so it&#8217;s <strong>highly recommended to upgrade your Gcal to 0.2 version</strong>. As always, for any kind of feedbacks or bug report, please leave a comment here <img src='http://www.jappit.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>]]></content:encoded>
			<wfw:commentRss>http://www.jappit.com/blog/2009/01/11/gcal-update-version-02-released/feed/</wfw:commentRss>
		<slash:comments>47</slash:comments>
		</item>
		<item>
		<title>Hosted accounts support added to GCal J2ME client</title>
		<link>http://www.jappit.com/blog/2008/12/27/hosted-accounts-support-added-to-gcal-j2me-client/</link>
		<comments>http://www.jappit.com/blog/2008/12/27/hosted-accounts-support-added-to-gcal-j2me-client/#comments</comments>
		<pubDate>Sat, 27 Dec 2008 10:55:30 +0000</pubDate>
		<dc:creator>pit</dc:creator>
				<category><![CDATA[cool stuff]]></category>
		<category><![CDATA[j2me]]></category>
		<category><![CDATA[mobile]]></category>
		<category><![CDATA[calendar]]></category>
		<category><![CDATA[gcal]]></category>
		<category><![CDATA[google calendar]]></category>
		<category><![CDATA[google calendar mobile]]></category>
		<category><![CDATA[java me]]></category>

		<guid isPermaLink="false">http://www.jappit.com/blog/?p=199</guid>
		<description><![CDATA[Christmas has passed, hope you had a great time! Now it&#8217;s time to prepare for New Year&#8217;s eve Meanwhile, here&#8217;s the first little upgrade to GCal, the J2ME Google Calendar client: if you use Google Apps with your mapped domain, now you can use your hosted accounts with GCal as well! Download GCal v0.1.1 here. [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Christmas</strong> has passed, hope you had a great time! Now it&#8217;s time to prepare for <strong>New Year&#8217;s eve</strong> <img src='http://www.jappit.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><img class="aligncenter" title="Christmas Gift" src="http://www.jappit.com/images/blog/uploads/christmas_gift.png" alt="" width="400" height="212" /></p>
<p>Meanwhile, here&#8217;s the <strong>first little upgrade to GCal</strong>, the <a title="J2ME Google Calendar client" href="http://www.jappit.com/blog/2008/12/22/j2me-google-calendar-client/">J2ME Google Calendar client</a>: if you use <a title="Google Apps" href="http://www.google.com/apps/intl/en/business/index.html" target="_blank">Google Apps</a> with your <strong>mapped domain</strong>, now you can use your <strong>hosted accounts</strong> with <strong>GCal</strong> as well!</p>
<p>Download GCal v0.1.1 <a title="J2ME Google Calendar download" href="http://www.jappit.com/download_j2me_google_calendar.htm">here</a>.</p>
<p style="text-align: center;"><a href="http://www.jappit.com/download_j2me_google_calendar.htm"><img class="aligncenter" title="J2ME Google Calendar download" src="http://www.jappit.com/images/blog/uploads/GCal_download.png" alt="" width="198" height="69" /></a></p>
<p style="text-align: left;"><strong>Edit:</strong> this version also <strong>fixes a bug</strong> with some <strong>Nokia S60 3rd edition FP2 devices</strong>, who previously got stuck at splash screen.</p>]]></content:encoded>
			<wfw:commentRss>http://www.jappit.com/blog/2008/12/27/hosted-accounts-support-added-to-gcal-j2me-client/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>J2ME Google Calendar client!</title>
		<link>http://www.jappit.com/blog/2008/12/22/j2me-google-calendar-client/</link>
		<comments>http://www.jappit.com/blog/2008/12/22/j2me-google-calendar-client/#comments</comments>
		<pubDate>Mon, 22 Dec 2008 14:44:16 +0000</pubDate>
		<dc:creator>pit</dc:creator>
				<category><![CDATA[cool stuff]]></category>
		<category><![CDATA[j2me]]></category>
		<category><![CDATA[mobile]]></category>
		<category><![CDATA[calendar]]></category>
		<category><![CDATA[gcal]]></category>
		<category><![CDATA[google calendar]]></category>
		<category><![CDATA[google calendar mobile]]></category>
		<category><![CDATA[java me]]></category>

		<guid isPermaLink="false">http://www.jappit.com/blog/?p=181</guid>
		<description><![CDATA[NEW: check out the new Gcal 0.3 version! Christmas is rapidly approaching, and it&#8217;s time for presents! For those who have always wanted a Google Calendar client for their Java ME enabled cellphones, it is finally here! It&#8217;s still an early alpha, but everyone is welcome to try it and give feedbacks. Features of this [...]]]></description>
			<content:encoded><![CDATA[<p><strong>NEW:</strong> check out the new <a title="J2ME Google Calendar" href="http://www.jappit.com/blog/2009/02/16/gcal-version-03-touch-support-local-events-and-a-bunch-of-fixes/">Gcal 0.3 version</a>!</p>
<p>Christmas is rapidly approaching, and it&#8217;s time for presents! <img src='http://www.jappit.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>For those who have always wanted a <a title="Google Calendar" href="http://calendar.google.com/" target="_blank">Google Calendar</a> client for their <a title="Java ME website" href="http://java.sun.com/javame/index.jsp" target="_blank">Java ME</a> enabled cellphones, <strong>it is finally here</strong>!</p>
<div class="wp-caption alignnone" style="width: 250px"><img title="J2ME Google Calendar splash screen" src="http://www.jappit.com/images/blog/uploads/GCal_splash2.gif" alt="" width="240" height="309" /><p class="wp-caption-text">J2ME Google Calendar</p></div>
<p style="text-align: center;"><a href="http://www.jappit.com/download_j2me_google_calendar.htm"><img class="aligncenter" title="Download J2ME Google Calendar" src="http://www.jappit.com/images/blog/uploads/GCal_download.png" alt="" width="198" height="69" /></a></p>
<p>It&#8217;s still an early alpha, but everyone is welcome to try it and give feedbacks.</p>
<p>Features of this first release include:</p>
<ul>
<li><strong>calendar filtering</strong></li>
<li><strong>events creation</strong></li>
<li><strong>event searching</strong></li>
<li>events location <strong>map viewing</strong></li>
</ul>
<p>And here are some <strong>screenshots</strong>:</p>
<div class="wp-caption alignnone" style="width: 250px"><img title="J2ME Google Calendar daily events" src="http://www.jappit.com/images/blog/uploads/GCal_entryList.gif" alt="" width="240" height="309" /><p class="wp-caption-text">Daily events</p></div>
<div class="wp-caption alignnone" style="width: 250px"><img title="J2ME Google Calendar calendars filter" src="http://www.jappit.com/images/blog/uploads/GCal_calendarFilter.gif" alt="Calendars filter" width="240" height="309" /><p class="wp-caption-text">Calendars filter</p></div>
<div class="wp-caption alignnone" style="width: 250px"><img title="J2ME Google Calendar create event" src="http://www.jappit.com/images/blog/uploads/GCal_createEvent.gif" alt="Event creation" width="240" height="291" /><p class="wp-caption-text">Event creation</p></div>
<div class="wp-caption alignnone" style="width: 250px"><img title="J2ME Google Calendar view map" src="http://www.jappit.com/images/blog/uploads/GCal_map.gif" alt="Event location map" width="240" height="309" /><p class="wp-caption-text">Event location map</p></div>
<div class="wp-caption alignnone" style="width: 250px"><img title="J2ME Google Calendar select date" src="http://www.jappit.com/images/blog/uploads/GCal_dateSelection.gif" alt="Date selection" width="240" height="309" /><p class="wp-caption-text">Date selection</p></div>
<div class="wp-caption alignnone" style="width: 250px"><img title="J2ME Google Calendar search event" src="http://www.jappit.com/images/blog/uploads/GCal_search.gif" alt="Event search" width="240" height="291" /><p class="wp-caption-text">Event search</p></div>
<div class="wp-caption alignnone" style="width: 250px"><img title="J2ME Google Calendar settings" src="http://www.jappit.com/images/blog/uploads/GCal_settings.gif" alt="Settings screen" width="240" height="309" /><p class="wp-caption-text">Settings screen</p></div>
<p>For all requests, feedbacks and bugs please leave a comment to this post <img src='http://www.jappit.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<h3>Release notes</h3>
<p>Compatibility issues:</p>
<ul>
<li>Some <strong>Nokia Series60 1st and 2nd edition devices</strong> have problems in handling HTTP redirects: I&#8217;m working on a fix, that will be available in a future GCal release</li>
<li><span style="text-decoration: line-through;">You must specify your <strong>account name without the &#8216;@gmail.com&#8217; part</strong>, otherwise authentication will fail (an automatic check will be added in the next release)</span>: you can now specify &#8216;@gmail.com&#8217; part in your account name, and authentication will fail no more. Also, if you&#8217;re using a mapped domain with Google, you can now use your hosted account data as well.</li>
</ul>]]></content:encoded>
			<wfw:commentRss>http://www.jappit.com/blog/2008/12/22/j2me-google-calendar-client/feed/</wfw:commentRss>
		<slash:comments>65</slash:comments>
		</item>
		<item>
		<title>A J2ME Calendar for all your Canvas!</title>
		<link>http://www.jappit.com/blog/2008/05/16/a-j2me-calendar-for-all-your-canvas/</link>
		<comments>http://www.jappit.com/blog/2008/05/16/a-j2me-calendar-for-all-your-canvas/#comments</comments>
		<pubDate>Fri, 16 May 2008 15:06:42 +0000</pubDate>
		<dc:creator>pit</dc:creator>
				<category><![CDATA[j2me]]></category>
		<category><![CDATA[mobile]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[calendar]]></category>
		<category><![CDATA[canvas]]></category>
		<category><![CDATA[date field]]></category>
		<category><![CDATA[date item]]></category>
		<category><![CDATA[date picker]]></category>
		<category><![CDATA[forumnokia]]></category>
		<category><![CDATA[source code]]></category>

		<guid isPermaLink="false">http://www.jappit.com/blog/?p=39</guid>
		<description><![CDATA[You know that J2ME support for Canvas is quite ridiculous.. One list, some form items, and stop. Canvas is left to its terrible destiny, with nothing more than a couple of lines and circles.. isn&#8217;t it sad? So, after this melodramatic introduction, we&#8217;re ready for today&#8217;s code: a fully featured, customizable, Canvas based calendar! If [...]]]></description>
			<content:encoded><![CDATA[<p>You know that J2ME support for Canvas is quite ridiculous.. One list, some form items, and stop. Canvas is left to its terrible destiny, with nothing more than a couple of lines and circles.. isn&#8217;t it sad?<br />
So, after this melodramatic introduction, we&#8217;re ready for today&#8217;s code: a fully featured, customizable, Canvas based calendar!</p>
<p><img src="http://www.jappit.com/images/blog/uploads/j2me_calendar.png" alt="J2me Canvas Date Picker screenshot" width="253" height="223" /></p>
<p>If you prefer a live demonstration rather than a simple screenshot, just go here: <a title="J2me Canvas date picker in emulator" href="http://www.jappit.com/index.php?page=emulator&amp;midlet=calendar_widget">Canvas Calendar in action</a>.</p>
<p>So, how to use it?</p>
<ol>
<li><strong>Download</strong> its source code (<a title="J2me calendar date picker source code" href="http://www.jappit.com/uploads/src/CalendarWidget.java">CalendarWidget.java</a>) and put it straight in your project</li>
<li><strong>Instantiate </strong>it within your Canvas with its plain-old-unique constructor:

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;">CalendarWidget calendar <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> CalendarWidget<span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">Date</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

</li>
<li><strong>Customize </strong>it with the colors/fonts/padding you prefer:

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;">calendar.<span style="color: #006633;">headerFont</span> <span style="color: #339933;">=</span> <span style="color: #003399;">Font</span>.<span style="color: #006633;">getFont</span><span style="color: #009900;">&#40;</span><span style="color: #003399;">Font</span>.<span style="color: #006633;">FACE_PROPORTIONAL</span>, <span style="color: #003399;">Font</span>.<span style="color: #006633;">STYLE_BOLD</span>, <span style="color: #003399;">Font</span>.<span style="color: #006633;">SIZE_LARGE</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
calendar.<span style="color: #006633;">weekdayFont</span> <span style="color: #339933;">=</span> <span style="color: #003399;">Font</span>.<span style="color: #006633;">getFont</span><span style="color: #009900;">&#40;</span><span style="color: #003399;">Font</span>.<span style="color: #006633;">FACE_PROPORTIONAL</span>, <span style="color: #003399;">Font</span>.<span style="color: #006633;">STYLE_BOLD</span>, <span style="color: #003399;">Font</span>.<span style="color: #006633;">SIZE_MEDIUM</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
calendar.<span style="color: #006633;">weekdayBgColor</span> <span style="color: #339933;">=</span> 0xccccff<span style="color: #339933;">;</span>
calendar.<span style="color: #006633;">weekdayColor</span> <span style="color: #339933;">=</span> 0x0000ff<span style="color: #339933;">;</span>
calendar.<span style="color: #006633;">headerColor</span> <span style="color: #339933;">=</span> 0xffffff<span style="color: #339933;">;</span></pre></div></div>

</li>
<li>After you&#8217;ve customized it, remember to always call its <strong>initialize</strong>() method:

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;">calendar.<span style="color: #006633;">initialize</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

</li>
<li>Now, to paint it, you can simply call its paint() method from your Canvas paint(), like this:

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">protected</span> <span style="color: #000066; font-weight: bold;">void</span> paint<span style="color: #009900;">&#40;</span><span style="color: #003399;">Graphics</span> g<span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
    g.<span style="color: #006633;">setColor</span><span style="color: #009900;">&#40;</span>0xffffff<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    g.<span style="color: #006633;">fillRect</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">0</span>, <span style="color: #cc66cc;">0</span>, getWidth<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>, getHeight<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    calendar.<span style="color: #006633;">paint</span><span style="color: #009900;">&#40;</span>g<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

</li>
<li>Now you must allow users to interact with it, so you can, for example, use Canvas keyPressed() method to interact with <em>calendar</em>:

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">protected</span> <span style="color: #000066; font-weight: bold;">void</span> keyPressed<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">int</span> key<span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
    <span style="color: #000066; font-weight: bold;">int</span> keyCode <span style="color: #339933;">=</span> getGameAction<span style="color: #009900;">&#40;</span>key<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #000000; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>keyCode <span style="color: #339933;">==</span> FIRE<span style="color: #009900;">&#41;</span>
    <span style="color: #009900;">&#123;</span>
        Display.<span style="color: #006633;">getDisplay</span><span style="color: #009900;">&#40;</span>midlet<span style="color: #009900;">&#41;</span>.<span style="color: #006633;">setCurrent</span><span style="color: #009900;">&#40;</span>
            <span style="color: #000000; font-weight: bold;">new</span> Alert<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Selected date&quot;</span>, calendar.<span style="color: #006633;">getSelectedDate</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">toString</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>, <span style="color: #000066; font-weight: bold;">null</span>, AlertType.<span style="color: #006633;">CONFIRMATION</span><span style="color: #009900;">&#41;</span>
        <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
    <span style="color: #000000; font-weight: bold;">else</span>
    <span style="color: #009900;">&#123;</span>
        calendar.<span style="color: #006633;">keyPressed</span><span style="color: #009900;">&#40;</span>keyCode<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        repaint<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>As you see, what we do is this:</p>
<ul>
<li>if the user press FIRE button, we alert the current selected date</li>
<li>otherwise we call <em>calendar</em> keyPressed() method, to make it behave accordingly</li>
</ul>
</li>
<li>Other customizable properties include:
<ul>
<li><strong>MONTH_LABELS</strong>: change this to customize month labels in your own language</li>
<li><strong>WEEKDAY_LABELS</strong>: as above, change this to customize weekday labels</li>
<li><strong>startWeekday</strong>: this represents the week starting day, and its values range goes from 0 (for Monday) to 6 (for Sunday)</li>
</ul>
</li>
</ol>
<p>You can download source code of the example described above here: <a title="J2me Calendar example source code" href="http://www.jappit.com/uploads/src/CalendarCanvas.java">CalendarCanvas.java</a>.</p>
<p>To get some more details about CalendarWidget source code, you can take a look at my article on Forum Nokia Wiki: <a title="J2ME Canvas based Calendar / Date Picker" href="http://wiki.forum.nokia.com/index.php/Building_a_J2ME_Canvas_based_calendar/date_picker" target="_blank">Building a J2ME Canvas based Calendar / Date picker</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.jappit.com/blog/2008/05/16/a-j2me-calendar-for-all-your-canvas/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>

