<?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>Inspiration and Expression &#187; Netbeans</title>
	<atom:link href="http://blogs.kiyut.com/tonny/category/java/netbeans/feed/" rel="self" type="application/rss+xml" />
	<link>http://blogs.kiyut.com/tonny</link>
	<description>KIYUT Developer Blog</description>
	<lastBuildDate>Fri, 29 Jun 2012 03:58:21 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.4</generator>
		<item>
		<title>Workaround BooleanStateAction in Mac OSX Global Menu</title>
		<link>http://blogs.kiyut.com/tonny/2012/06/18/workaround-booleanstateaction-in-mac-osx-global-menu/</link>
		<comments>http://blogs.kiyut.com/tonny/2012/06/18/workaround-booleanstateaction-in-mac-osx-global-menu/#comments</comments>
		<pubDate>Mon, 18 Jun 2012 09:06:24 +0000</pubDate>
		<dc:creator>Tonny Kohar</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Netbeans]]></category>
		<category><![CDATA[Netbeans Platform]]></category>

		<guid isPermaLink="false">http://blogs.kiyut.com/tonny/?p=171</guid>
		<description><![CDATA[If you are using BooleanStateAction and bitten by this bug #207477. And interestingly this bug is start to creep into Ubuntu Unity Global Menu as well (using Java Ayatana plugins). Below is the workaround. The idea is to maintain the JMenuItem reference ourselves and set the appropriate (checked/enabled) state. So you can inherit from WorkaroundBooleanStateAction [...]<div class="addthis_toolbox addthis_default_style " addthis:url='http://blogs.kiyut.com/tonny/2012/06/18/workaround-booleanstateaction-in-mac-osx-global-menu/' addthis:title='Workaround BooleanStateAction in Mac OSX Global Menu '  ><a class="addthis_button_facebook_like" fb:like:layout="button_count"></a><a class="addthis_button_tweet"></a><a class="addthis_button_google_plusone" g:plusone:size="medium"></a><a class="addthis_counter addthis_pill_style"></a></div>]]></description>
			<content:encoded><![CDATA[<p>If you are using BooleanStateAction and bitten by this bug #<a href="http://netbeans.org/bugzilla/show_bug.cgi?id=207477&#038;x=0&#038;y=0">207477</a>.<br />
And interestingly this bug is start to creep into Ubuntu Unity Global Menu as well (using Java Ayatana plugins).</p>
<p>Below is the workaround. The idea is to maintain the JMenuItem reference ourselves and set the appropriate (checked/enabled) state.<br />
So you can inherit from WorkaroundBooleanStateAction instead of original BooleanStateAction</p>
<p><span id="more-171"></span></p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">abstract</span> <span style="color: #000000; font-weight: bold;">class</span> WorkaroundBooleanStateAction <span style="color: #000000; font-weight: bold;">extends</span> BooleanStateAction <span style="color: #009900;">&#123;</span>
    <span style="color: #666666; font-style: italic;">// if needed do you own stuff</span>
&nbsp;
    <span style="color: #666666; font-style: italic;">/* XXX Netbeans Platform bug 207477
     * Workaround for Mac OSX Bug with BooleanStateAction enabled and selected
     * so keep track JMenuItem ourselves
     */</span>
    <span style="color: #000000; font-weight: bold;">private</span> WeakHashMap<span style="color: #339933;">&lt;</span><span style="color: #003399;">JMenuItem</span>, WeakReference<span style="color: #339933;">&lt;</span>JMenuItem<span style="color: #339933;">&gt;&gt;</span> menuItemsMap 
            <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> WeakHashMap<span style="color: #339933;">&lt;</span><span style="color: #003399;">JMenuItem</span>, WeakReference<span style="color: #339933;">&lt;</span>JMenuItem<span style="color: #339933;">&gt;&gt;</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    @Override
    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #003399;">JMenuItem</span> getMenuPresenter<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #003399;">Utilities</span>.<span style="color: #006633;">isWindows</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #000000; font-weight: bold;">return</span> <span style="color: #000000; font-weight: bold;">super</span>.<span style="color: #006633;">getMenuPresenter</span><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: #003399;">JMenuItem</span> menuItem <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">super</span>.<span style="color: #006633;">getMenuPresenter</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        menuItemsMap.<span style="color: #006633;">put</span><span style="color: #009900;">&#40;</span>menuItem,<span style="color: #000000; font-weight: bold;">new</span> WeakReference<span style="color: #339933;">&lt;</span>JMenuItem<span style="color: #339933;">&gt;</span><span style="color: #009900;">&#40;</span>menuItem<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #000000; font-weight: bold;">return</span> menuItem<span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    @Override
    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> setBooleanState<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">boolean</span> value<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000000; font-weight: bold;">super</span>.<span style="color: #006633;">setBooleanState</span><span style="color: #009900;">&#40;</span>value<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><span style="color: #339933;">!</span><span style="color: #003399;">Utilities</span>.<span style="color: #006633;">isWindows</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #000000; font-weight: bold;">for</span> <span style="color: #009900;">&#40;</span><span style="color: #003399;">JMenuItem</span> menuItem <span style="color: #339933;">:</span> menuItemsMap.<span style="color: #006633;">keySet</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                menuItem.<span style="color: #006633;">setSelected</span><span style="color: #009900;">&#40;</span>value<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #009900;">&#125;</span>
        <span style="color: #009900;">&#125;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    @Override
    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> setEnabled<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">boolean</span> value<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000000; font-weight: bold;">super</span>.<span style="color: #006633;">setEnabled</span><span style="color: #009900;">&#40;</span>value<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><span style="color: #339933;">!</span><span style="color: #003399;">Utilities</span>.<span style="color: #006633;">isWindows</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #000000; font-weight: bold;">for</span> <span style="color: #009900;">&#40;</span><span style="color: #003399;">JMenuItem</span> menuItem <span style="color: #339933;">:</span> menuItemsMap.<span style="color: #006633;">keySet</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                menuItem.<span style="color: #006633;">setEnabled</span><span style="color: #009900;">&#40;</span>value<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #009900;">&#125;</span>
        <span style="color: #009900;">&#125;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #666666; font-style: italic;">// if needed do you own stuff</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p><strong>note:</strong> above is a hack (workaround) without modifying any platform code. It is not proper solution</p>
<div class="addthis_toolbox addthis_default_style " addthis:url='http://blogs.kiyut.com/tonny/2012/06/18/workaround-booleanstateaction-in-mac-osx-global-menu/' addthis:title='Workaround BooleanStateAction in Mac OSX Global Menu '  ><a class="addthis_button_facebook_like" fb:like:layout="button_count"></a><a class="addthis_button_tweet"></a><a class="addthis_button_google_plusone" g:plusone:size="medium"></a><a class="addthis_counter addthis_pill_style"></a></div>]]></content:encoded>
			<wfw:commentRss>http://blogs.kiyut.com/tonny/2012/06/18/workaround-booleanstateaction-in-mac-osx-global-menu/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Netbeans and Ubuntu Unity</title>
		<link>http://blogs.kiyut.com/tonny/2012/06/11/netbeans-and-ubuntu-unity/</link>
		<comments>http://blogs.kiyut.com/tonny/2012/06/11/netbeans-and-ubuntu-unity/#comments</comments>
		<pubDate>Mon, 11 Jun 2012 10:44:23 +0000</pubDate>
		<dc:creator>Tonny Kohar</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Netbeans]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[Ubuntu Unity]]></category>

		<guid isPermaLink="false">http://blogs.kiyut.com/tonny/?p=159</guid>
		<description><![CDATA[If you are developing application with Netbeans in Ubuntu Unity environment, most likely the Netbeans menu is black (hard to spot) and in bold text (ugly). And this things effecting all java program. It is due to the ambience theme employed by Ubuntu which result in menu black and bold. And not only that, because [...]<div class="addthis_toolbox addthis_default_style " addthis:url='http://blogs.kiyut.com/tonny/2012/06/11/netbeans-and-ubuntu-unity/' addthis:title='Netbeans and Ubuntu Unity '  ><a class="addthis_button_facebook_like" fb:like:layout="button_count"></a><a class="addthis_button_tweet"></a><a class="addthis_button_google_plusone" g:plusone:size="medium"></a><a class="addthis_counter addthis_pill_style"></a></div>]]></description>
			<content:encoded><![CDATA[<p>If you are developing application with Netbeans in Ubuntu Unity environment, most likely the Netbeans menu is black (hard to spot) and in bold text (ugly). And this things effecting all java program. It is due to the ambience theme employed by Ubuntu which result in menu black and bold. And not only that, because the new Unity is using Unity Launcher and Global menu, all java application will looks weird on that environment eg: no global menu, wrong launcher icon, not integrated into Unity HUD, etc</p>
<p>So how to fix that. The menu black things can be solved by changing the ambience theme into another theme or you can edit the ambience theme resources definition file. But the global menu and HUD integration is harder to workaround.</p>
<p>Luckily if you are using Netbeans you can just use <a href="http://plugins.netbeans.org/plugin/41822/java-ayatana">Java Ayatana plugin</a> which solve all the problem above. Java Ayatana will integrate Netbeans nicely with Ubuntu Unity eg: Ubuntu global menu, Ubuntu HUD integration, Unity launcher fix, etc.</p>
<p><span id="more-159"></span></p>
<p>How to install Java Ayatana Plugins<br />
- In Netbeans, goto menu &#8211; Tools &#8211; Plugins<br />
- On the settings tab, add the Update Center, and use<br />
   * Name: Java Ayatana<br />
   * URL: http://java-swing-ayatana.googlecode.com/files/netbeans-catalog.xml<br />
- On the Available Plugins tab, choose reload, then find and install Java Ayatana<br />
- Restart Netbeans and done. Netbeans is integrated with Ubuntu Unity</p>
<p>For detailed instructions please visit <a href="http://plugins.netbeans.org/plugin/41822/java-ayatana">Java Ayatana plugins</a></p>
<p>And if by any case you are developing Netbeans Platform application, you also can use Java Ayatana plugins as extra cluster.</p>
<p><a href="http://blogs.kiyut.com/tonny/wp-content/uploads/2012/06/netbeans-unity.png"><img src="http://blogs.kiyut.com/tonny/wp-content/uploads/2012/06/netbeans-unity-400.png" alt="Netbeans in Ubuntu Unity Global Menu" border="0" /></a><br />
*see Ubuntu Unity global menu works</p>
<p><a href="http://blogs.kiyut.com/tonny/wp-content/uploads/2012/06/netbeans-unity-dash.png"><img src="http://blogs.kiyut.com/tonny/wp-content/uploads/2012/06/netbeans-unity-dash-400.png" alt="Netbeans in Ubuntu Unity HUD Integration" border="0" /></a><br />
*see Ubuntu Unity HUD integration</p>
<div class="addthis_toolbox addthis_default_style " addthis:url='http://blogs.kiyut.com/tonny/2012/06/11/netbeans-and-ubuntu-unity/' addthis:title='Netbeans and Ubuntu Unity '  ><a class="addthis_button_facebook_like" fb:like:layout="button_count"></a><a class="addthis_button_tweet"></a><a class="addthis_button_google_plusone" g:plusone:size="medium"></a><a class="addthis_counter addthis_pill_style"></a></div>]]></content:encoded>
			<wfw:commentRss>http://blogs.kiyut.com/tonny/2012/06/11/netbeans-and-ubuntu-unity/feed/</wfw:commentRss>
		<slash:comments>17</slash:comments>
		</item>
		<item>
		<title>How to build and sign Android APK using JDK 7 with Netbeans</title>
		<link>http://blogs.kiyut.com/tonny/2012/06/07/how-to-build-and-sign-android-apk-using-jdk-7-with-netbeans/</link>
		<comments>http://blogs.kiyut.com/tonny/2012/06/07/how-to-build-and-sign-android-apk-using-jdk-7-with-netbeans/#comments</comments>
		<pubDate>Thu, 07 Jun 2012 08:31:55 +0000</pubDate>
		<dc:creator>Tonny Kohar</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Netbeans]]></category>

		<guid isPermaLink="false">http://blogs.kiyut.com/tonny/?p=143</guid>
		<description><![CDATA[If you build and sign android application using jdk 7, the result apk could not be installed on physical device, see http://code.google.com/p/android/issues/detail?id=19567 It is because the default digest algorithm for Java 7 is SHA-256, see http://docs.oracle.com/javase/7/docs/technotes/tools/windows/jarsigner.html So one of the easiest way to sign android apk using jdk 7 is by adding the following to [...]<div class="addthis_toolbox addthis_default_style " addthis:url='http://blogs.kiyut.com/tonny/2012/06/07/how-to-build-and-sign-android-apk-using-jdk-7-with-netbeans/' addthis:title='How to build and sign Android APK using JDK 7 with Netbeans '  ><a class="addthis_button_facebook_like" fb:like:layout="button_count"></a><a class="addthis_button_tweet"></a><a class="addthis_button_google_plusone" g:plusone:size="medium"></a><a class="addthis_counter addthis_pill_style"></a></div>]]></description>
			<content:encoded><![CDATA[<p>If you build and sign android application using jdk 7, the result apk could not be installed on physical device,<br />
see <a href="http://code.google.com/p/android/issues/detail?id=19567">http://code.google.com/p/android/issues/detail?id=19567</a></p>
<p>It is because the default digest algorithm for Java 7 is SHA-256,<br />
see <a href="http://docs.oracle.com/javase/7/docs/technotes/tools/windows/jarsigner.html">http://docs.oracle.com/javase/7/docs/technotes/tools/windows/jarsigner.html</a></p>
<p>So one of the easiest way to sign android apk using jdk 7 is by adding the following to the build.xml</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;presetdef</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;signjar&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;signjar</span> <span style="color: #000066;">sigalg</span>=<span style="color: #ff0000;">&quot;MD5withRSA&quot;</span> <span style="color: #000066;">digestalg</span>=<span style="color: #ff0000;">&quot;SHA1&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/presetdef<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></td></tr></table></div>

<p>note: the above example is using Netbeans 7.1.2 with NbAndroid plugins.<br />
Other IDE should adjust accordingly.</p>
<div class="addthis_toolbox addthis_default_style " addthis:url='http://blogs.kiyut.com/tonny/2012/06/07/how-to-build-and-sign-android-apk-using-jdk-7-with-netbeans/' addthis:title='How to build and sign Android APK using JDK 7 with Netbeans '  ><a class="addthis_button_facebook_like" fb:like:layout="button_count"></a><a class="addthis_button_tweet"></a><a class="addthis_button_google_plusone" g:plusone:size="medium"></a><a class="addthis_counter addthis_pill_style"></a></div>]]></content:encoded>
			<wfw:commentRss>http://blogs.kiyut.com/tonny/2012/06/07/how-to-build-and-sign-android-apk-using-jdk-7-with-netbeans/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Netbeans and Android Development with NbAndroid</title>
		<link>http://blogs.kiyut.com/tonny/2011/08/12/netbeans-and-android-development-with-nbandroid/</link>
		<comments>http://blogs.kiyut.com/tonny/2011/08/12/netbeans-and-android-development-with-nbandroid/#comments</comments>
		<pubDate>Fri, 12 Aug 2011 03:49:06 +0000</pubDate>
		<dc:creator>Tonny Kohar</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Netbeans]]></category>

		<guid isPermaLink="false">http://blogs.kiyut.com/tonny/?p=131</guid>
		<description><![CDATA[If you haven&#8217;t aware that Netbeans support android development, please check out NbAndroid, it is a plugins for Netbeans IDE that provide support for the whole development cycle of Android applications. You just need to download the latest NbAndroid plugins from NbAndroid The Goto Menu &#8211; Tools &#8211; Options, on Miscellaneus &#8211; Android, and set [...]<div class="addthis_toolbox addthis_default_style " addthis:url='http://blogs.kiyut.com/tonny/2011/08/12/netbeans-and-android-development-with-nbandroid/' addthis:title='Netbeans and Android Development with NbAndroid '  ><a class="addthis_button_facebook_like" fb:like:layout="button_count"></a><a class="addthis_button_tweet"></a><a class="addthis_button_google_plusone" g:plusone:size="medium"></a><a class="addthis_counter addthis_pill_style"></a></div>]]></description>
			<content:encoded><![CDATA[<p>If you haven&#8217;t aware that Netbeans support android development, please check out <a href="http://kenai.com/projects/nbandroid/">NbAndroid</a>, it is a plugins for Netbeans IDE that provide support for the whole development cycle of Android applications.</p>
<ol>
<li> You just need to download the latest NbAndroid plugins from <a href="http://kenai.com/projects/nbandroid/">NbAndroid</a></li>
<li>The Goto Menu &#8211; Tools &#8211; Options,<br />
on Miscellaneus &#8211; Android,<br />
and set your android sdk there.</li>
<li>You are done.</li>
</ol>
<p><span id="more-131"></span></p>
<p>Now you are ready to develop Android App from Netbeans IDE</p>
<p><a href="http://blogs.kiyut.com/tonny/wp-content/uploads/2011/08/nbandroid.png"><img src="http://blogs.kiyut.com/tonny/wp-content/uploads/2011/08/nbandroid-thumb.jpg" alt="NbAndroid" border="0" /></a></p>
<p><a href="http://blogs.kiyut.com/tonny/wp-content/uploads/2011/08/nbandroid-wizard.png"><img src="http://blogs.kiyut.com/tonny/wp-content/uploads/2011/08/nbandroid-wizard-thumb.jpg" alt="NbAndroid Wizard" border="0" /></a></p>
<div class="addthis_toolbox addthis_default_style " addthis:url='http://blogs.kiyut.com/tonny/2011/08/12/netbeans-and-android-development-with-nbandroid/' addthis:title='Netbeans and Android Development with NbAndroid '  ><a class="addthis_button_facebook_like" fb:like:layout="button_count"></a><a class="addthis_button_tweet"></a><a class="addthis_button_google_plusone" g:plusone:size="medium"></a><a class="addthis_counter addthis_pill_style"></a></div>]]></content:encoded>
			<wfw:commentRss>http://blogs.kiyut.com/tonny/2011/08/12/netbeans-and-android-development-with-nbandroid/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Oracle Java Roadmap for Client Side</title>
		<link>http://blogs.kiyut.com/tonny/2010/10/28/oracle-java-roadmap-for-client-side/</link>
		<comments>http://blogs.kiyut.com/tonny/2010/10/28/oracle-java-roadmap-for-client-side/#comments</comments>
		<pubDate>Thu, 28 Oct 2010 06:43:39 +0000</pubDate>
		<dc:creator>Tonny Kohar</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Netbeans]]></category>
		<category><![CDATA[JavaFX]]></category>
		<category><![CDATA[Swing]]></category>

		<guid isPermaLink="false">http://blogs.kiyut.com/tonny/?p=101</guid>
		<description><![CDATA[Finally, Oracle speak about Java Roadmap especially for the client side at JavaOne 2010 JDK BOF session which you can see from Amy Fowler blog. From what I can understand, it boils down to several things: Java Swing Future It is still not very clear yet, how Java Swing will evolve in the future as [...]<div class="addthis_toolbox addthis_default_style " addthis:url='http://blogs.kiyut.com/tonny/2010/10/28/oracle-java-roadmap-for-client-side/' addthis:title='Oracle Java Roadmap for Client Side '  ><a class="addthis_button_facebook_like" fb:like:layout="button_count"></a><a class="addthis_button_tweet"></a><a class="addthis_button_google_plusone" g:plusone:size="medium"></a><a class="addthis_counter addthis_pill_style"></a></div>]]></description>
			<content:encoded><![CDATA[<p>Finally, Oracle speak about Java Roadmap especially for the client side at JavaOne 2010 JDK BOF session which you can see from <a href="http://amyfowlersblog.wordpress.com/2010/09/21/a-heartfelt-ramble-on-swing-javafx/">Amy Fowler blog</a>. From what I can understand, it boils down to several things:</p>
<p><span id="more-101"></span></p>
<h3>Java Swing Future</h3>
<p>It is still not very clear yet, how Java Swing will evolve in the future as said in the blog above</p>
<blockquote><p>The crux of the problem is that Swing is rooted in the antiquated AWT, rather than being integrated into the 2D coordinate system. Fixing this would require some massively incompatible changes and once you march down that path, well, you start asking yourself what other incompatible improvements should be made ….pretty soon the remodel becomes reconstruction and you realize that a new foundation is really needed.</p></blockquote>
<p>But don&#8217;t get me wrong, it is not whether Swing will vanish or not, of course everything will be evolved. But, the focus is on the <strong>evolution of Swing</strong> and it is still unclear how Swing will evolve in the future. As you can see from the things that I quote above, <em>&#8220;Swing is rooted in the antiquated AWT&#8230;  and fixing this would require some massively incompatible changes &#8230;remodel becomes reconstruction &#8230;&#8221;</em></p>
<p>However, the good news is that whatever decision Oracle made to Swing evolution, <em>&#8220;it’s still there and it isn’t going anywhere&#8221;</em> as Amy said. </p>
<h3>Java FX Future</h3>
<p>On the other hand, Java FX get the most focus and attention for Java client side and have much more clear <a href="http://javafx.com/roadmap/">roadmap</a>. In contrast to Swing, Java FX has more modern underlying structure (Prism + scene-graph + UI controls) plus a hardware-accelerated graphics pipeline with a UI rooted in a 2D/3D scene-graph can do. Imagine what you can do as Java developer for either business application or RIA media frenzy application like you saw on iPhone, etc with hundreds of rotating media cubes or jumbling block. It will gonna be interesting.</p>
<p>And from what I can understand from <a href="http://amyfowlersblog.wordpress.com/2010/09/21/a-heartfelt-ramble-on-swing-javafx/">Amy&#8217;s blog</a>. Currently, Oracle is converting JavaFX to a proper Java library and killing JavaFX script. So Java developers don’t have to learn a new language to use it. And the good news is <em>&#8220;&#8230; Much of the JavaFX stack has <strong>already been ported off of script</strong>, so this is all quite real and the team is ecstatic to be doing Java again..&#8221; said Amy</em></p>
<h3>Development Environment/Tools (Netbeans)</h3>
<p><em>&#8220;A sleeper detail from Thomas Kurian’s keynote is that NetBeans will be the Java development IDE of choice going forward. This is very good news for Swing, ensuring it’s support and upkeep for a long time to come.&#8221;</em></p>
<p>And on the JavaFX front <em>&#8220;we are working closely with that team to ensure JavaFX2.0 is toolable from the start.&#8221;</em></p>
<h3>Summary</h3>
<p>So my summary are<br />
- Swing evolution is uncertain yet, but Swing is here to stay.<br />
- JavaFX script is dead, but soon there will be JavaFX as Java library.<br />
- Netbeans will provide tooling support for JavaFX</p>
<p><strong>Sources:</strong></p>
<ul>
<li><a href="http://amyfowlersblog.wordpress.com/2010/09/21/a-heartfelt-ramble-on-swing-javafx/">A Heartfelt Ramble on Swing &#038; JavaFX</a></li>
<li><a href="http://fxexperience.com/2010/09/javafx-2-0/">JavaFX 2.0 at JavaOne 2010</a></li>
<li><a href="http://javafx.com/roadmap/">JavaFX 2010-2011 Roadmap</a></li>
</ul>
<div class="addthis_toolbox addthis_default_style " addthis:url='http://blogs.kiyut.com/tonny/2010/10/28/oracle-java-roadmap-for-client-side/' addthis:title='Oracle Java Roadmap for Client Side '  ><a class="addthis_button_facebook_like" fb:like:layout="button_count"></a><a class="addthis_button_tweet"></a><a class="addthis_button_google_plusone" g:plusone:size="medium"></a><a class="addthis_counter addthis_pill_style"></a></div>]]></content:encoded>
			<wfw:commentRss>http://blogs.kiyut.com/tonny/2010/10/28/oracle-java-roadmap-for-client-side/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Book Review: Netbeans Platform 6.9 Developer&#8217;s Guide</title>
		<link>http://blogs.kiyut.com/tonny/2010/09/15/book-review-netbeans-platform-69-developers-guide/</link>
		<comments>http://blogs.kiyut.com/tonny/2010/09/15/book-review-netbeans-platform-69-developers-guide/#comments</comments>
		<pubDate>Wed, 15 Sep 2010 10:16:05 +0000</pubDate>
		<dc:creator>Tonny Kohar</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Netbeans]]></category>
		<category><![CDATA[Book Review]]></category>
		<category><![CDATA[Netbeans Platform]]></category>

		<guid isPermaLink="false">http://blogs.kiyut.com/tonny/?p=79</guid>
		<description><![CDATA[Netbeans Platform 6.9 Developer&#8217;s Guide by Jürgen Petri comes with 273 pages. This is not Java beginner book or learning Java book, and not about Netbeans IDE as well. The author assumes zero Netbeans Platform knowledge. This book is written for developers who are comfortable with Java and Swing, and who would like to use [...]<div class="addthis_toolbox addthis_default_style " addthis:url='http://blogs.kiyut.com/tonny/2010/09/15/book-review-netbeans-platform-69-developers-guide/' addthis:title='Book Review: Netbeans Platform 6.9 Developer&#8217;s Guide '  ><a class="addthis_button_facebook_like" fb:like:layout="button_count"></a><a class="addthis_button_tweet"></a><a class="addthis_button_google_plusone" g:plusone:size="medium"></a><a class="addthis_counter addthis_pill_style"></a></div>]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.packtpub.com/netbeans-platform-6-8-developers-guide/book?utm_source=blogs.kiyut.com&#038;utm_medium=bookrev&#038;utm_content=blog&#038;utm_campaign=mdb_004434">Netbeans Platform 6.9 Developer&#8217;s Guide</a> by Jürgen Petri comes with 273 pages. This is not Java beginner book or learning Java book, and not about Netbeans IDE as well. The author assumes zero Netbeans Platform knowledge. This book is written for developers who are comfortable with Java and Swing, and who would like to use a framework (<a href="http://netbeans.org/features/platform/index.html">Netbeans Platform</a>) as the basis of their Swing applications. </p>
<p><span id="more-79"></span><br />
The chapters structure is nice and follow the logical step and easy to follow:</p>
<ul>
<li>Chapter 1, Module: the basic building block of Netbeans Platform Application.</li>
<li>Chapter 2, Forms: You learn how forms are created for usage on the NetBeans Platform, how their layout is set, and how to implement the related handling of events.
</li>
<li>Chapter 3, Window System: The NetBeans Window System, together with the API that it exposes, lets you arrange forms on the screen within a docking framework.
</li>
<li>Chapter 4, Lookup: The Lookup API provides a communication mechanism, comparable to an event bus, which is of central significance in the creation of NetBeans Platform applications.
</li>
<li>Chapter 5, Actions: You learn how to create actions and how to invoke them from menus and toolbars, including keyboard shortcut and context sensitive action.
</li>
<li>Chapter 6, Nodes and Explorer Views:  A sophisticated MVC implementation for displaying business objects is made available via a set of extensible Swing components, which you can use without very much work at all.
</li>
<li>Chapter 7, File System: The File System API lets you access a NetBeans Platform&#8217;s virtual filesystem, which serves as the application&#8217;s central registry and configuration system.
</li>
<li>Chapter 8, Data System: The Datasystems API gives you access to the content of files. You learn how to extend a NetBeans Platform application to provide support for custom data types.
</li>
<li>Chapter 9, Dialogs: The responsibilities of dialogs in an application extend from the display of simple messages to the management of step-by-step procedural wizards.
</li>
<li>Chapter 10, Settings: which introduces you to the most important APIs and the entry points into the centralized Options window.
</li>
<li>Chapter 11, Help: HTML files constituting your documentation can be integrated into the application which can be invoked using action or keyboard shortcut
</li>
<li>Chapter 12, Branding: which enables the application&#8217;s ancillary details, such as icons and splash screens, to be customized.
</li>
<li>Chapter 13, Distribution and Updates: To let you distribute applications, and examine the various distribution mechanisms for NetBeans Platform applications including installer and online update.</ul>
</li>
<p>Important, the book&#8217;s author write </p>
<blockquote><p>&#8220;This book doesn&#8217;t aim to explicate all that the NetBeans Platform offers or to explore each and every corner of its many features. Rather, this book guides you through the development of a specific Java desktop application, while showing you everything that is relevant in the context of the particular application itself. That process, in turn, will lead you through the main features relevant to the development of most general<br />
applications on the NetBeans Platform.&#8221;</p></blockquote>
<p>For me, this book is really good to introduce Netbeans Platform development. It discuss all or most important API in Netbeans Platform from basic module creation to deployment and how to integrate them all together. Another good thing is this book using single application sample (Task Management Application) through out all the chapters. So each chapter add more features to the application sample, rather than each chapter using different example to describe the Netbeans Platform API. However, this book is not without flaw. Chapter 2 (Forms) discuss too much about Swing Layout and Netbeans Form Builder which is not necessary (IMHO, this book is not about Swing and Netbeans IDE, but about Netbeans Platform). Other than that, the book is good introduction to Netbeans Platform development.</p>
<p>I have been developing Netbeans Platform Application since few years and release (public release) at least 3 applications based on Netbeans Platform, so I know my way around Netbeans Platform API. But this book still give me few surprises regarding Netbeans API, and my favorite is the Lookup API (Chapter 4). And yes you can teach old dog new trick <img src='http://blogs.kiyut.com/tonny/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Link To the Book</p>
<ul>
<li><a href="http://www.packtpub.com/netbeans-platform-6-8-developers-guide/book?utm_source=blogs.kiyut.com&#038;utm_medium=bookrev&#038;utm_content=blog&#038;utm_campaign=mdb_004434">Netbeans Platform 6.9 Developer&#8217;s Guide</a></li>
<li><a href="http://wiki.netbeans.org/PetriEnglishTranslationErrata">Book Errata</a></li>
<li><a href="http://netbeanside61.blogspot.com/2010/09/book-review-netbeans-platform-69.html">Another Review of this book</a> by Tushar Joshi</li>
</ul>
<p>Additional Link related to Netbeans Platform</p>
<ul>
<li><a href="http://edu.netbeans.org/contrib/slides/netbeans-platform/">NetBeans Platform Teaching Resources</a></li>
</ul>
<div class="addthis_toolbox addthis_default_style " addthis:url='http://blogs.kiyut.com/tonny/2010/09/15/book-review-netbeans-platform-69-developers-guide/' addthis:title='Book Review: Netbeans Platform 6.9 Developer&#8217;s Guide '  ><a class="addthis_button_facebook_like" fb:like:layout="button_count"></a><a class="addthis_button_tweet"></a><a class="addthis_button_google_plusone" g:plusone:size="medium"></a><a class="addthis_counter addthis_pill_style"></a></div>]]></content:encoded>
			<wfw:commentRss>http://blogs.kiyut.com/tonny/2010/09/15/book-review-netbeans-platform-69-developers-guide/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Netbeans Platform RTL (Right To Left) Component Orientation</title>
		<link>http://blogs.kiyut.com/tonny/2009/10/21/netbeans-platform-right-to-left-component-orientation/</link>
		<comments>http://blogs.kiyut.com/tonny/2009/10/21/netbeans-platform-right-to-left-component-orientation/#comments</comments>
		<pubDate>Wed, 21 Oct 2009 06:33:41 +0000</pubDate>
		<dc:creator>Tonny Kohar</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Netbeans]]></category>
		<category><![CDATA[Netbeans Platform]]></category>

		<guid isPermaLink="false">http://blogs.kiyut.com/tonny/?p=55</guid>
		<description><![CDATA[If you haven&#8217;t aware Java have support for RTL (Right-To-Left) for the User Interface, and thank to Netbeans Platform based on Swing, it is easy as well to make Netbeans Platform application to support RTL (Right-To-Left) as well Step 1: Create ComponentOrientation support class This step is optional, but make the testing easier, because it [...]<div class="addthis_toolbox addthis_default_style " addthis:url='http://blogs.kiyut.com/tonny/2009/10/21/netbeans-platform-right-to-left-component-orientation/' addthis:title='Netbeans Platform RTL (Right To Left) Component Orientation '  ><a class="addthis_button_facebook_like" fb:like:layout="button_count"></a><a class="addthis_button_tweet"></a><a class="addthis_button_google_plusone" g:plusone:size="medium"></a><a class="addthis_counter addthis_pill_style"></a></div>]]></description>
			<content:encoded><![CDATA[<p>If you haven&#8217;t aware Java have support for RTL (Right-To-Left) for the User Interface, and thank to Netbeans Platform based on Swing, it is easy as well to make Netbeans Platform application to support RTL (Right-To-Left) as well</p>
<h3>Step 1: Create ComponentOrientation support class</h3>
<p>This step is optional, but make the testing easier, because it use the value component orientation from System.getProperty(&#8220;..&#8221;), and use auto (based on Locale.getDefault() if nothing specified.</p>
<p><span id="more-55"></span></p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="java" style="font-family:monospace;">    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> ComponentOrientationSupport <span style="color: #009900;">&#123;</span>
&nbsp;
        <span style="color: #000000; font-weight: bold;">private</span> ComponentOrientationSupport<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #000000; font-weight: bold;">throw</span> <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">Error</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;ComponentOrientationSupport is a utility class for static methods&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// NOI18N</span>
        <span style="color: #009900;">&#125;</span>   
&nbsp;
        <span style="color: #008000; font-style: italic; font-weight: bold;">/** 
         * Return component orientation base on the value of
         * {@code System.getProperty(&quot;alkitab.orientation&quot;)} &lt;br/&gt;
         * If it is not specified it will return ComponentOrientation.LEFT_TO_RIGHT
         * Possible value are:
         * &lt;code&gt;
         * - auto (Default), automatic setting based on Locale.getDefault()
         * - ltr, force to use Left to Right orientation
         * - rtl, force to use Right to Left orientation
         * &lt;/code&gt;
         * @return ComponentOrientation
         */</span>
        <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #003399;">ComponentOrientation</span> getComponentOrientation<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #003399;">ComponentOrientation</span> orient <span style="color: #339933;">=</span> <span style="color: #003399;">ComponentOrientation</span>.<span style="color: #006633;">getOrientation</span><span style="color: #009900;">&#40;</span><span style="color: #003399;">Locale</span>.<span style="color: #006633;">getDefault</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
            <span style="color: #003399;">String</span> str <span style="color: #339933;">=</span> <span style="color: #003399;">System</span>.<span style="color: #006633;">getProperty</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;component.orientation&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
            <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>str <span style="color: #339933;">!=</span> <span style="color: #000066; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>str.<span style="color: #006633;">equals</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;ltr&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                    orient <span style="color: #339933;">=</span> <span style="color: #003399;">ComponentOrientation</span>.<span style="color: #006633;">LEFT_TO_RIGHT</span><span style="color: #339933;">;</span>
                <span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">else</span> <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>str.<span style="color: #006633;">equals</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;rtl&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                    orient <span style="color: #339933;">=</span> <span style="color: #003399;">ComponentOrientation</span>.<span style="color: #006633;">RIGHT_TO_LEFT</span><span style="color: #339933;">;</span>
                <span style="color: #009900;">&#125;</span>
            <span style="color: #009900;">&#125;</span>
&nbsp;
            <span style="color: #000000; font-weight: bold;">return</span> orient<span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
&nbsp;
        <span style="color: #008000; font-style: italic; font-weight: bold;">/** Apply the getComponentOrientation to the specified container
         * @param container Container
         */</span>
        <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #000066; font-weight: bold;">void</span> applyComponentOrientation<span style="color: #009900;">&#40;</span><span style="color: #003399;">Container</span> container<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            container.<span style="color: #006633;">applyComponentOrientation</span><span style="color: #009900;">&#40;</span>getComponentOrientation<span style="color: #009900;">&#40;</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: #009900;">&#125;</span></pre></td></tr></table></div>

<h3>Step 2: Apply the component orientation for the MainWindow</h3>
<p>In order to apply the component orientation to the MainWindow, you need to do that in the ModuleInstall eg:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="java" style="font-family:monospace;">    @Override
    <span style="color: #000000; font-weight: bold;">public</span>  <span style="color: #000066; font-weight: bold;">void</span> restored<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000000; font-weight: bold;">super</span>.<span style="color: #006633;">restored</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #666666; font-style: italic;">// initialize the orientation</span>
        <span style="color: #003399;">String</span> orientationKey <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;component.orientation&quot;</span><span style="color: #339933;">;</span>
        <span style="color: #003399;">String</span> strOrientation <span style="color: #339933;">=</span> <span style="color: #003399;">System</span>.<span style="color: #006633;">getProperty</span><span style="color: #009900;">&#40;</span>orientationKey<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>strOrientation <span style="color: #339933;">==</span> <span style="color: #000066; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            strOrientation <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;auto&quot;</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>
            strOrientation <span style="color: #339933;">=</span> strOrientation.<span style="color: #006633;">trim</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">toLowerCase</span><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: #003399;">System</span>.<span style="color: #006633;">setProperty</span><span style="color: #009900;">&#40;</span>orientationKey, strOrientation<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// re-setting the System property to the correct value</span>
&nbsp;
        <span style="color: #666666; font-style: italic;">// do something else</span>
        <span style="color: #666666; font-style: italic;">//....</span>
&nbsp;
        WindowManager.<span style="color: #006633;">getDefault</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">invokeWhenUIReady</span><span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">Runnable</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> run<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                ComponentOrientationSupport.<span style="color: #006633;">applyComponentOrientation</span><span style="color: #009900;">&#40;</span>WindowManager.<span style="color: #006633;">getDefault</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">getMainWindow</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
                <span style="color: #666666; font-style: italic;">// do something else</span>
                <span style="color: #666666; font-style: italic;">//....</span>
            <span style="color: #009900;">&#125;</span>
        <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<h3>Step 3: Apply the component orientation for each TopComponent</h3>
<p>You need to apply component orientation for each TopComponent you have eg:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="java" style="font-family:monospace;">    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">final</span> <span style="color: #000000; font-weight: bold;">class</span> MyTopComponent <span style="color: #000000; font-weight: bold;">extends</span> TopComponent <span style="color: #009900;">&#123;</span>
        <span style="color: #000000; font-weight: bold;">private</span> MyTopComponent<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            initComponents<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            setName<span style="color: #009900;">&#40;</span>...<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            setToolTipText<span style="color: #009900;">&#40;</span>...<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
            <span style="color: #666666; font-style: italic;">// do something else</span>
            <span style="color: #666666; font-style: italic;">//....</span>
&nbsp;
            ComponentOrientationSupport.<span style="color: #006633;">applyComponentOrientation</span><span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">this</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></td></tr></table></div>

<h3>Step 4: Testing</h3>
<p>Because it is using System.getProperty(&#8220;..&#8221;), so it is easy to test the UI. You only need to assign that component.orientation=auto|ltr|rtl to the environment. In Netbeans Platform based application you can do that in the suite project.properties by adding</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="java" style="font-family:monospace;">run.<span style="color: #006633;">args</span>.<span style="color: #006633;">extra</span><span style="color: #339933;">=-</span>J<span style="color: #339933;">-</span>Dcomponent.<span style="color: #006633;">orientation</span><span style="color: #339933;">=</span>rtl ...<span style="color: #006633;">your</span> other things eg<span style="color: #339933;">:</span> <span style="color: #339933;">-</span>J<span style="color: #339933;">-</span>Xms64m <span style="color: #339933;">-</span>J<span style="color: #339933;">-</span>Xmx128m ...</pre></td></tr></table></div>

<p>Or for deploying you can use ../etc/yourapp.conf as above. Or if you are not setting it up, it will use &#8220;auto&#8221; by default which is based on Locale.getDefault()</p>
<div class="addthis_toolbox addthis_default_style " addthis:url='http://blogs.kiyut.com/tonny/2009/10/21/netbeans-platform-right-to-left-component-orientation/' addthis:title='Netbeans Platform RTL (Right To Left) Component Orientation '  ><a class="addthis_button_facebook_like" fb:like:layout="button_count"></a><a class="addthis_button_tweet"></a><a class="addthis_button_google_plusone" g:plusone:size="medium"></a><a class="addthis_counter addthis_pill_style"></a></div>]]></content:encoded>
			<wfw:commentRss>http://blogs.kiyut.com/tonny/2009/10/21/netbeans-platform-right-to-left-component-orientation/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Who are using Netbeans Platform ?</title>
		<link>http://blogs.kiyut.com/tonny/2009/10/14/who-are-using-netbeans-platform/</link>
		<comments>http://blogs.kiyut.com/tonny/2009/10/14/who-are-using-netbeans-platform/#comments</comments>
		<pubDate>Wed, 14 Oct 2009 07:21:14 +0000</pubDate>
		<dc:creator>Tonny Kohar</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Netbeans]]></category>

		<guid isPermaLink="false">http://blogs.kiyut.com/tonny/?p=44</guid>
		<description><![CDATA[Did you ever wondering who (companies or developers) are using Netbeans Platform as their platform of choice ? You will be surprised if you check this Netbeans Platform Screenshot Showcase. There are a lot of them from various categories: Aerospace &#038; Defence, Oil &#038; Gas Services, Geospatial, Bio &#038; Chemoinformatics, Scientific Modelers, Monitors, &#038; Analyzers, [...]<div class="addthis_toolbox addthis_default_style " addthis:url='http://blogs.kiyut.com/tonny/2009/10/14/who-are-using-netbeans-platform/' addthis:title='Who are using Netbeans Platform ? '  ><a class="addthis_button_facebook_like" fb:like:layout="button_count"></a><a class="addthis_button_tweet"></a><a class="addthis_button_google_plusone" g:plusone:size="medium"></a><a class="addthis_counter addthis_pill_style"></a></div>]]></description>
			<content:encoded><![CDATA[<p>Did you ever wondering who (companies or developers) are using Netbeans Platform as their platform of choice ? You will be surprised if you check this <a href="http://platform.netbeans.org/screenshots.html">Netbeans Platform Screenshot Showcase</a>. </p>
<p>There are a lot of them from various categories: Aerospace &#038; Defence, Oil &#038; Gas Services, Geospatial, Bio &#038; Chemoinformatics, Scientific Modelers, Monitors, &#038; Analyzers, Healthcare, Network Management &#038; Communications Systems, Retail, Graphic Design &#038; Image Manipulation, Music &#038; Entertainment, Software Development. </p>
<p><span id="more-44"></span></p>
<p>So let&#8217;s me iterate again (<a href="http://blogs.kiyut.com/tonny/2007/11/21/rich-client-platform-rcp-why/">or read this instead</a>) why it is good idea to use <strong>RCP (Rich Client Platform) vs Java plus libraries.</strong> For me Rich Client Platform (RCP) is a set of libraries with <strong>tight integration</strong>, it was build from ground up to <strong>work together</strong> as a platform so other application can be build or run on top of it. In contrast, Java plus libraries is <strong>a mix and match of libraries</strong> to support the application eg: give new features, etc.</p>
<p>One main problem with the mix and match style is because that libraries may not be designed to work together, they could be excellent library on its own, but once they integrated together to form a single system (an application), sometimes it may require some glue or bridge code to make them work together. On the other hands for RCP, these set of libraries will work together since it is designed that way from beginning.</p>
<div class="addthis_toolbox addthis_default_style " addthis:url='http://blogs.kiyut.com/tonny/2009/10/14/who-are-using-netbeans-platform/' addthis:title='Who are using Netbeans Platform ? '  ><a class="addthis_button_facebook_like" fb:like:layout="button_count"></a><a class="addthis_button_tweet"></a><a class="addthis_button_google_plusone" g:plusone:size="medium"></a><a class="addthis_counter addthis_pill_style"></a></div>]]></content:encoded>
			<wfw:commentRss>http://blogs.kiyut.com/tonny/2009/10/14/who-are-using-netbeans-platform/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Netbeans Platform Friend dependencies</title>
		<link>http://blogs.kiyut.com/tonny/2009/05/27/netbeans-platform-friend-dependencies/</link>
		<comments>http://blogs.kiyut.com/tonny/2009/05/27/netbeans-platform-friend-dependencies/#comments</comments>
		<pubDate>Wed, 27 May 2009 07:47:40 +0000</pubDate>
		<dc:creator>Tonny Kohar</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Netbeans]]></category>
		<category><![CDATA[Netbeans Platform]]></category>

		<guid isPermaLink="false">http://blogs.kiyut.com/tonny/2009/05/27/netbeans-platform-friend-dependencies/</guid>
		<description><![CDATA[Recently on the nbdev (dev@openide.netbeans.org) mailing list someone ask a question regarding friend dependencies, because he/she I got the following Error: The module some.package.path is not a friend of some-path\some.jar So what is friend dependency anyways. Friend Dependency is caused by a Module that have an API which its author is not yet comfortable exposing [...]<div class="addthis_toolbox addthis_default_style " addthis:url='http://blogs.kiyut.com/tonny/2009/05/27/netbeans-platform-friend-dependencies/' addthis:title='Netbeans Platform Friend dependencies '  ><a class="addthis_button_facebook_like" fb:like:layout="button_count"></a><a class="addthis_button_tweet"></a><a class="addthis_button_google_plusone" g:plusone:size="medium"></a><a class="addthis_counter addthis_pill_style"></a></div>]]></description>
			<content:encoded><![CDATA[<p>Recently on the nbdev (<a href="http://openide.netbeans.org/servlets/SummarizeList?listName=dev">dev@openide.netbeans.org</a>) mailing list someone ask a question regarding friend dependencies, because he/she I got the following Error: </p>
<blockquote><p>
The module some.package.path <strong>is not a friend</strong> of some-path\some.jar
</p></blockquote>
<p>So what is friend dependency anyways. Friend Dependency is caused by a Module that have an API which its author is not yet comfortable exposing to just anyone, because it might not be fully stabilized yet. In this case, the module with the API can declare some public packages, but also stipulate that only a predefined list of &#8220;friend modules&#8221; are permitted to use them. The friend modules just declare a regular specification version dependency, but unknown modules are not permitted to use any packages from the API module.</p>
<p>So in order to declare a dependency to that module, you need to use <strong>an implementation dependency</strong>. Please read the following <a href="http://wiki.netbeans.org/DevFaqImplementationDependency">Netbeans Wiki Dev FAQ</a> on how to declare this implementation dependency and to enable friend dependency.</p>
<p><strong>note:</strong> please also understand that implementation dependencies cause special problems for Auto Update. It is explained on the Netbeans Wiki Dev FAQ as well</p>
<div class="addthis_toolbox addthis_default_style " addthis:url='http://blogs.kiyut.com/tonny/2009/05/27/netbeans-platform-friend-dependencies/' addthis:title='Netbeans Platform Friend dependencies '  ><a class="addthis_button_facebook_like" fb:like:layout="button_count"></a><a class="addthis_button_tweet"></a><a class="addthis_button_google_plusone" g:plusone:size="medium"></a><a class="addthis_counter addthis_pill_style"></a></div>]]></content:encoded>
			<wfw:commentRss>http://blogs.kiyut.com/tonny/2009/05/27/netbeans-platform-friend-dependencies/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Java Penetration Statistics</title>
		<link>http://blogs.kiyut.com/tonny/2009/01/06/java-penetration-statistics/</link>
		<comments>http://blogs.kiyut.com/tonny/2009/01/06/java-penetration-statistics/#comments</comments>
		<pubDate>Tue, 06 Jan 2009 08:01:08 +0000</pubDate>
		<dc:creator>Tonny Kohar</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[KIYUT]]></category>
		<category><![CDATA[Netbeans]]></category>
		<category><![CDATA[Deploy]]></category>
		<category><![CDATA[Java version]]></category>

		<guid isPermaLink="false">http://blogs.kiyut.com/tonny/2009/01/06/java-penetration-statistics/</guid>
		<description><![CDATA[This Java statistics is based on http://www.kiyut.com (not this blog, this blog is tracked separately). Basically, it is a B2C sites which specialize in Java Desktop Application. If you are wondering how do we track Java version, please visit this step by step guide on how to track java version using google analytics at http://cowwoc.blogspot.com/2008/11/tracking-java-versions-using-google.html [...]<div class="addthis_toolbox addthis_default_style " addthis:url='http://blogs.kiyut.com/tonny/2009/01/06/java-penetration-statistics/' addthis:title='Java Penetration Statistics '  ><a class="addthis_button_facebook_like" fb:like:layout="button_count"></a><a class="addthis_button_tweet"></a><a class="addthis_button_google_plusone" g:plusone:size="medium"></a><a class="addthis_counter addthis_pill_style"></a></div>]]></description>
			<content:encoded><![CDATA[<p>This Java statistics is based on <a href="http://www.kiyut.com">http://www.kiyut.com</a> (not this blog, this blog is tracked separately). Basically, it is a B2C sites which specialize in Java Desktop Application.</p>
<p>If you are wondering how do we track Java version, please visit this step by step guide on how to track java version using google analytics at<br />
<a href="http://cowwoc.blogspot.com/2008/11/tracking-java-versions-using-google.html">http://cowwoc.blogspot.com/2008/11/tracking-java-versions-using-google.html</a></p>
<p>Here is our Java visitor stats, it is fresh from Google Analytics data 05 December 2008 &#8211; 05 January 2009</p>
<p><img src="http://blogs.kiyut.com/tonny/wp-content/uploads/2009/01/java-visit.png" alt="Java Visitors" border="0" /></p>
<p><span id="more-39"></span><br />
and the corresponding Operating System (OS) stats</p>
<p><img src="http://blogs.kiyut.com/tonny/wp-content/uploads/2009/01/os-visit.png" alt="OS Visitors" border="0" /><br />
<br/><br/></p>
<p>Based on the above, Java 1.6_xx seems to have very nice grounds, and the Java 1.5 (9.36%) seems come from Mac OSX (12.90%), not set is probably from visitor who disable javascript (noscript).</p>
<p>The only things that <strong>puzzle me</strong> is the Java 1.8.0 (6.59%). Where does it come from or is there really a Java 1.8.0 ? If you know where this 1.8.0 come from, please do not hesitate to drop me a note.</p>
<div class="addthis_toolbox addthis_default_style " addthis:url='http://blogs.kiyut.com/tonny/2009/01/06/java-penetration-statistics/' addthis:title='Java Penetration Statistics '  ><a class="addthis_button_facebook_like" fb:like:layout="button_count"></a><a class="addthis_button_tweet"></a><a class="addthis_button_google_plusone" g:plusone:size="medium"></a><a class="addthis_counter addthis_pill_style"></a></div>]]></content:encoded>
			<wfw:commentRss>http://blogs.kiyut.com/tonny/2009/01/06/java-penetration-statistics/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
