<?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>PHP Architect blog &#187; JAVA</title>
	<atom:link href="http://www.php-architect.com/blog/category/java/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.php-architect.com/blog</link>
	<description>me, myself, and my code</description>
	<lastBuildDate>Wed, 14 Sep 2011 12:50:44 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>Virtualbox hidden gems, VBoxManage</title>
		<link>http://www.php-architect.com/blog/2010/10/23/virtualbox-hidden-gems-vboxmanage/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=virtualbox-hidden-gems-vboxmanage</link>
		<comments>http://www.php-architect.com/blog/2010/10/23/virtualbox-hidden-gems-vboxmanage/#comments</comments>
		<pubDate>Sat, 23 Oct 2010 10:19:07 +0000</pubDate>
		<dc:creator>aibrahim</dc:creator>
				<category><![CDATA[JAVA]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Mac OS]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[Unix]]></category>
		<category><![CDATA[CLI]]></category>
		<category><![CDATA[oracle]]></category>
		<category><![CDATA[VBoxManage]]></category>
		<category><![CDATA[VrtualBox]]></category>
		<guid isPermaLink="false">http://www.php-architect.com/blog/?p=7265</guid>
		<description><![CDATA[<a href="http://www.php-architect.com/blog/2010/10/23/virtualbox-hidden-gems-vboxmanage/" title="Virtualbox hidden gems, VBoxManage"></a>Virtual box has this little secret, the Command Line interface (CLI), this is very useful for users who wants to manage their virtual boxes on headless servers. Question is why using command line while you have a nice easy to &#8230;<p class="read-more"><a href="http://www.php-architect.com/blog/2010/10/23/virtualbox-hidden-gems-vboxmanage/">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<a href="http://www.php-architect.com/blog/2010/10/23/virtualbox-hidden-gems-vboxmanage/" title="Virtualbox hidden gems, VBoxManage"></a><iframe src="http://www.facebook.com/plugins/like.php?href=http://www.php-architect.com/blog/2010/10/23/virtualbox-hidden-gems-vboxmanage/&amp;layout=standard&amp;show_faces=1&amp;width=450&amp;action=like&amp;colorscheme=light&amp;font=" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:450px; height:25px"></iframe><p>Virtual box has this little secret, the Command Line interface (CLI), this is very useful for users who wants to manage their virtual boxes on headless servers.</p>
<p>Question is why using command line while you have a nice easy to use GUI, the answer is POWER. you can do anything with the virtual box command line, you can create virtual machines, modify their settings, take snapshots, start and shutdown them.</p>
<p>VBoxManage supports everything the graphical user interface does, and much more.</p>
<p>VBoxManage has its share of Virtual Box documentation, you can find it here <a title="VBoxManage - Virtual Box Command Line Interface" href="http://www.virtualbox.org/manual/ch08.html" target="_blank">http://www.virtualbox.org/manual/ch08.html</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.php-architect.com/blog/2010/10/23/virtualbox-hidden-gems-vboxmanage/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installing Java plugin for Firefox on Ubuntu 10.10 (Maverick)</title>
		<link>http://www.php-architect.com/blog/2010/10/19/installing-java-plugin-for-firefox-on-ubuntu-10-10-maverick/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=installing-java-plugin-for-firefox-on-ubuntu-10-10-maverick</link>
		<comments>http://www.php-architect.com/blog/2010/10/19/installing-java-plugin-for-firefox-on-ubuntu-10-10-maverick/#comments</comments>
		<pubDate>Tue, 19 Oct 2010 11:56:02 +0000</pubDate>
		<dc:creator>aibrahim</dc:creator>
				<category><![CDATA[JAVA]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[firefox]]></category>
		<category><![CDATA[maverick]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[ubuntu10.10]]></category>
		<guid isPermaLink="false">http://www.php-architect.com/blog/?p=6920</guid>
		<description><![CDATA[<a href="http://www.php-architect.com/blog/2010/10/19/installing-java-plugin-for-firefox-on-ubuntu-10-10-maverick/" title="Installing Java plugin for Firefox on Ubuntu 10.10 (Maverick)"></a>Again after upgrading from Ubuntu 9.10 to 10.4, I had some issues getting Java to work with Firefox, after checking the software center, I found that the Java plugin for firefox is not working properly which broke my vpn connection. &#8230;<p class="read-more"><a href="http://www.php-architect.com/blog/2010/10/19/installing-java-plugin-for-firefox-on-ubuntu-10-10-maverick/">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<a href="http://www.php-architect.com/blog/2010/10/19/installing-java-plugin-for-firefox-on-ubuntu-10-10-maverick/" title="Installing Java plugin for Firefox on Ubuntu 10.10 (Maverick)"></a><iframe src="http://www.facebook.com/plugins/like.php?href=http://www.php-architect.com/blog/2010/10/19/installing-java-plugin-for-firefox-on-ubuntu-10-10-maverick/&amp;layout=standard&amp;show_faces=1&amp;width=450&amp;action=like&amp;colorscheme=light&amp;font=" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:450px; height:25px"></iframe><p>Again after upgrading from Ubuntu 9.10 to 10.4, I had some issues getting Java to work with Firefox, after checking the software center, I found that the Java plugin for firefox is not working properly which broke my vpn connection.</p>
<p>To get this fixed, I simply followed the steps :</p>
<p>1- Backup your repositories files.</p>
<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">cp</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>apt<span style="color: #000000; font-weight: bold;">/</span>sources.list <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>apt<span style="color: #000000; font-weight: bold;">/</span>sources.list.backup</pre></div></div>
<p>2- Open your repositories file:</p>
<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> gedit <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>apt<span style="color: #000000; font-weight: bold;">/</span>sources.list</pre></div></div>
<p>3- Add the following line then close the sources.list file</p>
<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">deb http://archive.canonical.com/ubuntu maverick partner</pre></div></div>
<p>4- Uninstall both icedtea6-plugin and openjdk-6-jre.</p>
<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get</span> remove icedtea6-plugin openjdk-<span style="color: #000000;">6</span>-jre</pre></div></div>
<p>5- Install sun-java6-plugin</p>
<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get</span> update
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> sun-java6-plugin
<span style="color: #c20cb9; font-weight: bold;">sudo</span> update-alternatives <span style="color: #660033;">--install</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>mozilla<span style="color: #000000; font-weight: bold;">/</span>plugins<span style="color: #000000; font-weight: bold;">/</span>mozilla-javaplugin.so mozilla-javaplugin.so <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>jvm<span style="color: #000000; font-weight: bold;">/</span>java-<span style="color: #000000;">6</span>-sun<span style="color: #000000; font-weight: bold;">/</span>jre<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>i386<span style="color: #000000; font-weight: bold;">/</span>libnpjp2.so <span style="color: #000000;">1</span></pre></div></div>
<p>6- Close your firefox and reopen it again, it should be working smoothly.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.php-architect.com/blog/2010/10/19/installing-java-plugin-for-firefox-on-ubuntu-10-10-maverick/feed/</wfw:commentRss>
		<slash:comments>18</slash:comments>
		</item>
		<item>
		<title>Installing Java plugin for Firefox on Ubuntu 10.4 (Lucid)</title>
		<link>http://www.php-architect.com/blog/2010/05/01/installing-java-plugin-for-firefox-on-ubuntu-10-4-lucid/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=installing-java-plugin-for-firefox-on-ubuntu-10-4-lucid</link>
		<comments>http://www.php-architect.com/blog/2010/05/01/installing-java-plugin-for-firefox-on-ubuntu-10-4-lucid/#comments</comments>
		<pubDate>Sat, 01 May 2010 09:41:17 +0000</pubDate>
		<dc:creator>aibrahim</dc:creator>
				<category><![CDATA[JAVA]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[firefox]]></category>
		<category><![CDATA[lucid]]></category>
		<category><![CDATA[plugin]]></category>
		<guid isPermaLink="false">http://www.php-architect.com/blog/?p=379</guid>
		<description><![CDATA[<a href="http://www.php-architect.com/blog/2010/05/01/installing-java-plugin-for-firefox-on-ubuntu-10-4-lucid/" title="Installing Java plugin for Firefox on Ubuntu 10.4 (Lucid)"></a>After upgrading from Ubuntu 9.10 to 10.4, I had some issues getting Java to work with Firefox, after checking the software center, I found that the Java plugin has been removed. To get this fixed, I simply followed the steps &#8230;<p class="read-more"><a href="http://www.php-architect.com/blog/2010/05/01/installing-java-plugin-for-firefox-on-ubuntu-10-4-lucid/">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<a href="http://www.php-architect.com/blog/2010/05/01/installing-java-plugin-for-firefox-on-ubuntu-10-4-lucid/" title="Installing Java plugin for Firefox on Ubuntu 10.4 (Lucid)"></a><iframe src="http://www.facebook.com/plugins/like.php?href=http://www.php-architect.com/blog/2010/05/01/installing-java-plugin-for-firefox-on-ubuntu-10-4-lucid/&amp;layout=standard&amp;show_faces=1&amp;width=450&amp;action=like&amp;colorscheme=light&amp;font=" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:450px; height:25px"></iframe><p>After upgrading from Ubuntu 9.10 to 10.4, I had some issues getting Java to work with Firefox, after checking the software center, I found that the Java plugin has been removed.</p>
<p>To get this fixed, I simply followed the steps in here <a href="http://ubuntuforums.org/showpost.php?p=9008918&amp;postcount=32" target="_blank">http://ubuntuforums.org/showpost.php?p=9008918&amp;postcount=32</a> and it worked well after that.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.php-architect.com/blog/2010/05/01/installing-java-plugin-for-firefox-on-ubuntu-10-4-lucid/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Manage your notes / Code snippets with Snippely</title>
		<link>http://www.php-architect.com/blog/2009/11/14/manage-your-notes-code-snippets-with-snippely/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=manage-your-notes-code-snippets-with-snippely</link>
		<comments>http://www.php-architect.com/blog/2009/11/14/manage-your-notes-code-snippets-with-snippely/#comments</comments>
		<pubDate>Sat, 14 Nov 2009 17:27:35 +0000</pubDate>
		<dc:creator>aibrahim</dc:creator>
				<category><![CDATA[Favorites]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[JAVA]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[air]]></category>
		<category><![CDATA[Snippely]]></category>
		<guid isPermaLink="false">http://www.php-architect.com/blog/?p=351</guid>
		<description><![CDATA[<a href="http://www.php-architect.com/blog/2009/11/14/manage-your-notes-code-snippets-with-snippely/" title="Manage your notes / Code snippets with Snippely"></a>It has been a challenge for me to keep tracking code snippets I want to remember, I have always used text files, or sending my self email with the snippet that I feel I am gonna need to look at &#8230;<p class="read-more"><a href="http://www.php-architect.com/blog/2009/11/14/manage-your-notes-code-snippets-with-snippely/">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<a href="http://www.php-architect.com/blog/2009/11/14/manage-your-notes-code-snippets-with-snippely/" title="Manage your notes / Code snippets with Snippely"></a><iframe src="http://www.facebook.com/plugins/like.php?href=http://www.php-architect.com/blog/2009/11/14/manage-your-notes-code-snippets-with-snippely/&amp;layout=standard&amp;show_faces=1&amp;width=450&amp;action=like&amp;colorscheme=light&amp;font=" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:450px; height:25px"></iframe><p style="text-align: left;">It has been a challenge for me to keep tracking code snippets I want to remember, I have always used text files, or sending my self email with the snippet that I feel I am gonna need to look at again in the future, same for notes also.</p>
<p style="text-align: left;">Today I have found this nice Air App called Snippely, it allow you to manage your notes / code snippets, It is enough for me and better than text files and emails, I believe I am gonna stick to it for now.</p>
<p style="text-align: center;">
<a href="http://code.google.com/p/snippely/"><img title="Snippely" src="http://mootools.net/snippely.png" alt="Snippely" width="256" height="256" /></a>
<p style="text-align: left;">Only Two options I wish to see in the coming version, to backup / restore the data &amp; to sync the data across many machines, but like I said, I am happy with what I have now.</p>
<p style="text-align: left;">You can get Snippely from their Google Code page : <a href="http://code.google.com/p/snippely/" target="_blank">http://code.google.com/p/snippely/</a></p>
<p style="text-align: left;">I hope you will find it as much useful as I did.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.php-architect.com/blog/2009/11/14/manage-your-notes-code-snippets-with-snippely/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Zend Whitepapers &#8211; PHP Leads the way</title>
		<link>http://www.php-architect.com/blog/2009/04/22/zend-whitepapers-php-leads-the-way/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=zend-whitepapers-php-leads-the-way</link>
		<comments>http://www.php-architect.com/blog/2009/04/22/zend-whitepapers-php-leads-the-way/#comments</comments>
		<pubDate>Wed, 22 Apr 2009 10:55:59 +0000</pubDate>
		<dc:creator>aibrahim</dc:creator>
				<category><![CDATA[Favorites]]></category>
		<category><![CDATA[JAVA]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[zend framework]]></category>
		<category><![CDATA[oracle]]></category>
		<category><![CDATA[php4]]></category>
		<category><![CDATA[php5]]></category>
		<category><![CDATA[web2]]></category>
		<category><![CDATA[zend]]></category>
		<category><![CDATA[zendserver]]></category>
		<guid isPermaLink="false">http://www.php-architect.com/blog/?p=304</guid>
		<description><![CDATA[<a href="http://www.php-architect.com/blog/2009/04/22/zend-whitepapers-php-leads-the-way/" title="Zend Whitepapers - PHP Leads the way"></a>I have been browsing Zend website, and i have been going through its white papers, and it is really interesting, so i thought about sharing it with my blog visitors Zend White Papers An overview on PHP (PDF) This paper &#8230;<p class="read-more"><a href="http://www.php-architect.com/blog/2009/04/22/zend-whitepapers-php-leads-the-way/">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<a href="http://www.php-architect.com/blog/2009/04/22/zend-whitepapers-php-leads-the-way/" title="Zend Whitepapers - PHP Leads the way"></a><iframe src="http://www.facebook.com/plugins/like.php?href=http://www.php-architect.com/blog/2009/04/22/zend-whitepapers-php-leads-the-way/&amp;layout=standard&amp;show_faces=1&amp;width=450&amp;action=like&amp;colorscheme=light&amp;font=" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:450px; height:25px"></iframe><p>I have been browsing <a href="http://www.zend.com" target="_blank">Zend website</a>, and i have been going through its white papers, and it is really interesting, so i thought about sharing it with my blog visitors</p>
<div class="col-main">
<h3>Zend White Papers</h3>
<p><a style="font-weight: bold;" href="http://www.zend.com/topics/overview_on_php.pdf">An overview on PHP (PDF)</a></p>
<p><a style="font-weight: bold;" href="http://www.zend.com/topics/overview_on_php.pdf"></a>This paper gives a clear and concise overview of PHP. The paper covers many aspects of PHP, it goes through the history of PHP, the people behind PHP, the PHP market, the future of PHP, and more.</p>
<p><a style="font-weight: bold;" href="http://www.zend.com/topics/php_leads_web2_0.pdf">PHP Leads Web 2.0 (PDF)</a><br />
This paper defines and applies Web 2.0 for today’s users. Though it is difficult to define Web 2.0 there are usually a few common denominators such as, rich web applications, SOA (service oriented architecture), and social Web elements. This paper also explains what Web 2.0 means for the Enterprise and what it means for technology today.</p>
<p><a style="font-weight: bold;" href="http://www.zend.com/topics/White-paper-PHP4-PHP5.pdf">PHP 4 to PHP 5 Migration (PDF)</a><br />
A little over three years ago, the PHP community released version 5 of its popular programming language. PHP5 has now become the version of choice for many new PHP projects. PHP4 however remains popular and is still widely used. This whitepaper is aimed at developers who are still using PHP4 and considering switching to PHP5. It is also intended to provide IT managers responsible for PHP applications additional information for their decision on whether to stick with their current version or migrate. This paper seeks to answer the questions, “What are the benefits of migrating to PHP5? And, equally importantly, what are the risks?” The information below will put you in a better position to make an informed decision between PHP4 and PHP5.</p>
<div class="content-col"><a class="title_link" href="http://www.zend.com/topics/Team-Development-With-Zend-Studio-for-Eclipse.pdf"><strong></strong></a><strong><a class="title_link" href="http://static.zend.com/topics/Zend-Server-Data-Caching-Whitepaper-0106-T-WP-R1-EN.pdf">A Practical Guide to Data Caching with Zend Server</a></strong><br />
<span class="title_link">When asked about the most significant methods to speed up PHP applications, most experts would say “Cache, Cache and Cache”. There are a lot of optimizations that could be done to PHP code that would make it run faster, but the most effective method to speed up PHP execution is to simply execute less, and one of the best ways to achieve that is through caching.</span></p>
<p><strong><a class="title_link" href="http://www.zend.com/topics/Team-Development-With-Zend-Studio-for-Eclipse.pdf">Team Development with Zend Studio for Eclipse</a></strong><br />
Today’s development organizations are under ever increasing pressure to be more productive. One key factor for productivity is effective coordination across development teams. Learn how Zend Studio for Eclipse can help improve productivity and team coordination with capabilities to allow for effective use of Source Code Management, Code Refactoring, integration between development and deployment environments and more.<br />
<a style="font-weight: bold;" href="http://www.zend.com/topics/0200-T-WP-1107-R1-EN-PHP-is-not-Java-Seesions-in-PHP.pdf">PHP is Not Java: Session Management White Paper (PDF)</a><br />
PHP is used by developers that have a wide range of backgrounds and skill levels. When writing scalable PHP applications, it is crucial to understand the “shared nothing“ architecture of PHP. The most misunderstood component in this architecture is the session handling. PHP sessions are different from the ones used in other languages. Due to the “shared nothing“ architecture of PHP, objects cannot survive a request. Session data is therefore serialized to external storage for each request, meaning that only serializable data can be stored, not resources such as DB handles. This is a very powerful and scalable approach for session data averaging around 10-100kb, as serialized session storage can easily be spread over a cluster and serialization does not introduce a great deal of overhead.</p>
<p><a style="font-weight: bold;" href="http://www.zend.com/topics/zend_download_server.pdf">Zend Download Server (PDF)</a><br />
This paper will explain how the Apache web server works. The paper will answer key question such as: How do large file downloads affect your server’s performance? What is the difference between web page and file download serving? What do you do when your web server gets saturation? Additionally, this paper clearly defines and explains what Zend Download Server does.</p>
<p><a style="font-weight: bold;" href="http://www.zend.com/topics/scalability_responsiveness_with_zend_platforms_job_queue.pdf">Scalability and Responsiveness with Zend Platform’s Job Queue (PDF)</a><br />
This paper defines Job Queue for users. The paper also details as well as explains how Job Queue is used and how it works.</p>
<p><a style="font-weight: bold;" href="http://www.zend.com/topics/integrating_php_with_systemi_using_web_services.pdf">Integrating PHP with System I using Web Services (PDF)</a><br />
The following paper examines the ways in which PHP and Zend helps System I developers. The paper demonstrates how quick and simple it is to create a Web Service wrapper for an existing RPG program.</p>
<p><a style="font-weight: bold;" href="http://www.zend.com/topics/oracle_and_php.pdf">PHP and Oracle (PDF)</a><br />
The following paper explains how to install and utilize Zend Framework to develop applications in PHP.</div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.php-architect.com/blog/2009/04/22/zend-whitepapers-php-leads-the-way/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Appcelerator :: Building RIA Apps and Use Cases with ease</title>
		<link>http://www.php-architect.com/blog/2008/11/20/appcelerator-building-ria-applications-and-use-cases-with-ease/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=appcelerator-building-ria-applications-and-use-cases-with-ease</link>
		<comments>http://www.php-architect.com/blog/2008/11/20/appcelerator-building-ria-applications-and-use-cases-with-ease/#comments</comments>
		<pubDate>Thu, 20 Nov 2008 21:35:17 +0000</pubDate>
		<dc:creator>aibrahim</dc:creator>
				<category><![CDATA[Favorites]]></category>
		<category><![CDATA[JAVA]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[Updates]]></category>
		<category><![CDATA[Web Design]]></category>
		<category><![CDATA[zend framework]]></category>
		<category><![CDATA[agile]]></category>
		<category><![CDATA[appcelerator]]></category>
		<category><![CDATA[SOUI]]></category>
		<category><![CDATA[UI]]></category>
		<category><![CDATA[use cases]]></category>
		<category><![CDATA[web development]]></category>
		<category><![CDATA[zf]]></category>
		<guid isPermaLink="false">http://www.php-architect.com/blog/?p=125</guid>
		<description><![CDATA[<a href="http://www.php-architect.com/blog/2008/11/20/appcelerator-building-ria-applications-and-use-cases-with-ease/" title="Appcelerator :: Building RIA Apps and Use Cases with ease"></a>Yesterday i was browsing Zend Framework Webinars, and i stopped by the title : Get &#8220;Rich&#8221; Quick : Building Ajax-based RIAs with the Zend Framework and Appcelerator i didn&#8217;t hear about the Appcelerator thing before, but the title was really &#8230;<p class="read-more"><a href="http://www.php-architect.com/blog/2008/11/20/appcelerator-building-ria-applications-and-use-cases-with-ease/">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<a href="http://www.php-architect.com/blog/2008/11/20/appcelerator-building-ria-applications-and-use-cases-with-ease/" title="Appcelerator :: Building RIA Apps and Use Cases with ease"></a><iframe src="http://www.facebook.com/plugins/like.php?href=http://www.php-architect.com/blog/2008/11/20/appcelerator-building-ria-applications-and-use-cases-with-ease/&amp;layout=standard&amp;show_faces=1&amp;width=450&amp;action=like&amp;colorscheme=light&amp;font=" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:450px; height:25px"></iframe><p>Yesterday i was browsing Zend Framework <a href="http://www.zend.com/resources/webinars/framework" target="_blank">Webinars</a>, and i stopped by the title :</p>
<h4><a href="http://www.zend.com/en/webinar/Framework/webinar-rec-framework-bus-EN-appcelerator-20081015.flv" target="_blank">Get &#8220;Rich&#8221; Quick : Building Ajax-based RIAs with the Zend Framework and Appcelerator</a></h4>
<p>i didn&#8217;t hear about the Appcelerator thing before, but the title was really interesting as i use Zend framework extensively and it is a great idea to add some interactivity and UI to my apps.</p>
<p>after watching the webinars, i really liked the idea of being able to build the full prototype and have it working with no server side code, and then in the development phase with some slight changes to the prototype, it becomes the working front end interacting with the server side code with no problems @ all.</p>
<p>i went to <a href="http://try.appcelerator.org/" target="_blank">try.appcelerator.org</a> and gave it a try on the fly, that got me more interested. so i downloaded the sdk installer for MAC and installed it, the installation was at ease, even creating the projects and testing.</p>
<p>Appcelerator supports what we call &#8220;technology driven agile development&#8221; and we call that process Interactive Use Cases. </p>
]]></content:encoded>
			<wfw:commentRss>http://www.php-architect.com/blog/2008/11/20/appcelerator-building-ria-applications-and-use-cases-with-ease/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Completion of IBM Java Programming Diploma</title>
		<link>http://www.php-architect.com/blog/2008/06/08/completion-of-ibm-java-programming-diploma/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=completion-of-ibm-java-programming-diploma</link>
		<comments>http://www.php-architect.com/blog/2008/06/08/completion-of-ibm-java-programming-diploma/#comments</comments>
		<pubDate>Sat, 07 Jun 2008 22:43:01 +0000</pubDate>
		<dc:creator>aibrahim</dc:creator>
				<category><![CDATA[Events]]></category>
		<category><![CDATA[JAVA]]></category>
		<category><![CDATA[My Work]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Status]]></category>
		<guid isPermaLink="false">http://www.abdelaliem.com/?p=60</guid>
		<description><![CDATA[<a href="http://www.php-architect.com/blog/2008/06/08/completion-of-ibm-java-programming-diploma/" title="Completion of IBM Java Programming Diploma"></a>I have got my certification of completion of Java Programming Diploma last week. The most usefull thing i got from this course is the stong concept of OOP in java which helped me a lot in PHP especially after working &#8230;<p class="read-more"><a href="http://www.php-architect.com/blog/2008/06/08/completion-of-ibm-java-programming-diploma/">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<a href="http://www.php-architect.com/blog/2008/06/08/completion-of-ibm-java-programming-diploma/" title="Completion of IBM Java Programming Diploma"></a><iframe src="http://www.facebook.com/plugins/like.php?href=http://www.php-architect.com/blog/2008/06/08/completion-of-ibm-java-programming-diploma/&amp;layout=standard&amp;show_faces=1&amp;width=450&amp;action=like&amp;colorscheme=light&amp;font=" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:450px; height:25px"></iframe><p>I have got my certification of completion of Java Programming Diploma last week.</p>
<p>The most usefull thing i got from this course is the stong concept of OOP in java which helped me a lot in PHP especially after working with PHP5 which is diversed to the OOP conecpt. and also using Zend Framework.</p>
<p>i would like to thank the one who encouraged me to take it. ; i am satisfied with it and it was something i must have taken.</p>
<p>i have written some Java tutorials here, i will right more when i am done with the couple of projects i am taking care of now.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.php-architect.com/blog/2008/06/08/completion-of-ibm-java-programming-diploma/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The future is PHP</title>
		<link>http://www.php-architect.com/blog/2008/06/04/the-future-is-php/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=the-future-is-php</link>
		<comments>http://www.php-architect.com/blog/2008/06/04/the-future-is-php/#comments</comments>
		<pubDate>Wed, 04 Jun 2008 15:44:31 +0000</pubDate>
		<dc:creator>aibrahim</dc:creator>
				<category><![CDATA[JAVA]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Updates]]></category>
		<category><![CDATA[Web Design]]></category>
		<guid isPermaLink="false">http://www.abdelaliem.com/?p=57</guid>
		<description><![CDATA[<a href="http://www.php-architect.com/blog/2008/06/04/the-future-is-php/" title="The future is PHP"></a>With PHP continuing to gain massive support from programmers looking to expand their programming horizon, new versions of the language are likely to be geared towards solidifying its position as opposed to revolutionising. The job market is telling nothing but &#8230;<p class="read-more"><a href="http://www.php-architect.com/blog/2008/06/04/the-future-is-php/">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<a href="http://www.php-architect.com/blog/2008/06/04/the-future-is-php/" title="The future is PHP"></a><iframe src="http://www.facebook.com/plugins/like.php?href=http://www.php-architect.com/blog/2008/06/04/the-future-is-php/&amp;layout=standard&amp;show_faces=1&amp;width=450&amp;action=like&amp;colorscheme=light&amp;font=" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:450px; height:25px"></iframe><div class="entrybody">
<div class="snap_preview">
<p>With PHP continuing to gain massive support from programmers looking to expand their programming horizon, new versions of the language are likely to be geared towards solidifying its position as opposed to revolutionising.</p>
<p style="text-align: center;"><a href="http://phpimpact.files.wordpress.com/2008/05/permanent-demand-trendaspx.png" rel="lightbox[51]"><img class="alignnone size-full wp-image-187" src="http://phpimpact.files.wordpress.com/2008/05/permanent-demand-trendaspx.png?w=480&amp;h=218" alt="" width="480" height="218" /></a><br />
<em>The job market is telling nothing but good news</em></p>
<p>When Perl 6 was being designed, many huge changes were brought that alienated a lot of developers &#8211; hopefully PHP will not go the same way.In the meantime, be happy that you have chosen such a popular language that is advancing so quickly &#8211; PHP is here to stay, and things are only going to get better.The simplicity of scripting language PHP means it will be more popular than Java for building Web-based applications, Internet browser pioneer <a href="http://en.wikipedia.org/wiki/Marc_Andreessen">Marc Andreessen</a> predicted in a speech in Burlingame, California, at the Zend/PHP Conference.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.php-architect.com/blog/2008/06/04/the-future-is-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Action Event Handling in JAVA</title>
		<link>http://www.php-architect.com/blog/2008/01/09/action-event-handling-in-java/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=action-event-handling-in-java</link>
		<comments>http://www.php-architect.com/blog/2008/01/09/action-event-handling-in-java/#comments</comments>
		<pubDate>Tue, 08 Jan 2008 22:37:16 +0000</pubDate>
		<dc:creator>aibrahim</dc:creator>
				<category><![CDATA[JAVA]]></category>
		<guid isPermaLink="false">http://www.abdelaliem.com/blog/?p=23</guid>
		<description><![CDATA[<a href="http://www.php-architect.com/blog/2008/01/09/action-event-handling-in-java/" title="Action Event Handling in JAVA"></a>Throughout AWT, and all Java APIs for that matter, event handling has been consistent: Implement a listener interface (such as java.awt.event.ActionListener) Provide an implementation of all listener interface methods (such as actionPerformed( ActionEvent e )) Add your class as a &#8230;<p class="read-more"><a href="http://www.php-architect.com/blog/2008/01/09/action-event-handling-in-java/">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<a href="http://www.php-architect.com/blog/2008/01/09/action-event-handling-in-java/" title="Action Event Handling in JAVA"></a><iframe src="http://www.facebook.com/plugins/like.php?href=http://www.php-architect.com/blog/2008/01/09/action-event-handling-in-java/&amp;layout=standard&amp;show_faces=1&amp;width=450&amp;action=like&amp;colorscheme=light&amp;font=" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:450px; height:25px"></iframe><p>Throughout AWT, and all Java APIs for that matter, event handling has been consistent:</p>
<ol>
<li>Implement a listener interface (such as <tt>java.awt.event.ActionListener</tt>)</li>
<li>Provide an implementation of all listener interface methods (such as <tt>actionPerformed( ActionEvent e )</tt>)</li>
<li>Add your class as a listener to a component, which generates events by calling its <em>addXXXListener()</em> method (such as calling <tt>javax.swing.JButton</tt>&#8216;s <tt>addActionListener()</tt> method)</li>
</ol>
<p>i will go through 3 methods to perform Action Event Handling in Java</p>
<p><strong>First method: </strong></p>
<p>1- create a Handler Class in a separate file that implements from ActionListener interface.</p>
<p>2- overwrite the abstract method actionPerformed of the ActionListener interface, with the code we want to be executed upon the action on our object.</p>
<p>3- create instance of the Handler class, and add it as an action listener on the object we want like button for example.</p>
<p>Example :</p>
<p>in the following example we will create a button from the swing library, and apply the action that when a user click the button, we will show a message dialog.</p>
<p>File Handler.class</p>
<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
</pre></td><td class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">java.awt.event.*</span><span style="color: #339933;">;</span>import <span style="color: #006699;">java.awt.*</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">javax.swing.*</span><span style="color: #339933;">;</span><span style="color: #008000; font-style: italic; font-weight: bold;">/**
&nbsp;
*
&nbsp;
* @author ahmedabdelaliem
&nbsp;
*/</span>
&nbsp;
<span style="color: #666666; font-style: italic;">//we create the Handler class and implement from ActionListener interface</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> Handler <span style="color: #000000; font-weight: bold;">implements</span> <span style="color: #003399;">ActionListener</span><span style="color: #009900;">&#123;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">//now we overwrite the abstract method of ActionListener interface</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> actionPerformed <span style="color: #009900;">&#40;</span><span style="color: #003399;">ActionEvent</span> event<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// here goes the code we want to execute when the action happen, for example show a message dialog with the below text</span>
&nbsp;
<span style="color: #003399;">JOptionPane</span>.<span style="color: #006633;">showMessageDialog</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">null</span>, <span style="color: #0000ff;">&quot;You Have just clicked the button&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>
<p>file ButtonTest.java</p>
<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
</pre></td><td class="code"><pre class="java" style="font-family:monospace;"><span style="color: #008000; font-style: italic; font-weight: bold;">/** *
&nbsp;
* @author ahmedabdelaliem
&nbsp;
*/</span>
&nbsp;
<span style="color: #666666; font-style: italic;">/*
&nbsp;
* To change this template, choose Tools | Templates
&nbsp;
* and open the template in the editor.
&nbsp;
*/</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">java.awt.*</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">javax.swing.*</span><span style="color: #339933;">;</span><span style="color: #666666; font-style: italic;">// we create our class and inherit from JFrame to create our GUI</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> ButtonTest <span style="color: #000000; font-weight: bold;">extends</span> <span style="color: #003399;">JFrame</span><span style="color: #009900;">&#123;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// we create an empty reference with JButton type</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">private</span> <span style="color: #003399;">JButton</span> plainButton,<span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// we create the constructor of the class</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">public</span> ButtonTest<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">//set up the container</span>
&nbsp;
<span style="color: #003399;">Container</span> con <span style="color: #339933;">=</span> getContentPane<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
con.<span style="color: #006633;">setLayout</span><span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">FlowLayout</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;">// create an object of the JButton</span>
&nbsp;
plainButton <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">JButton</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
plainButton.<span style="color: #006633;">setText</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Regular Button&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// set the text on the button</span>
&nbsp;
<span style="color: #666666; font-style: italic;">//create an object of our Handler</span>
&nbsp;
Handler h <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> Handler<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;">// now we add the Handler object we created as Action Listener for the button</span>
&nbsp;
plainButton.<span style="color: #006633;">addActionListener</span><span style="color: #009900;">&#40;</span>h<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">//now we add the button to the container and show the frame.</span>
&nbsp;
con.<span style="color: #006633;">add</span><span style="color: #009900;">&#40;</span>plainButton<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
setSize<span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">400</span>,<span style="color: #cc66cc;">300</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
setVisible<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>
<p>file Main.java</p>
<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
</pre></td><td class="code"><pre class="java" style="font-family:monospace;"><span style="color: #008000; font-style: italic; font-weight: bold;">/** *
&nbsp;
* @author ahmedabdelaliem
&nbsp;
*/</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> Main <span style="color: #009900;">&#123;</span>
&nbsp;
<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> main<span style="color: #009900;">&#40;</span><span style="color: #003399;">String</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> args<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// we create an object of our ButtonTest Class</span>
&nbsp;
ButtonTest b1 <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> ButtonTest<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
b1.<span style="color: #006633;">setDefaultCloseOperation</span><span style="color: #009900;">&#40;</span>b1.<span style="color: #006633;">EXIT_ON_CLOSE</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>    <span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>
<p>now the output of this simple application : a frame will show with a button on it, and when we click the button a message dialog will appear.</p>
<p>the disadvantage of this method is that we need to create a separate handler for each object we want a handler for,</p>
<p>for example if we have a form with 10 buttons with different actions when clicked, then we  need to create 10 Handlers in 10 files with 10 different actions</p>
<p>that doesn&#8217;t make sense at all.</p>
<p>so this is why we follow one of the next 2 methods,</p>
<p>Method 2 :  create the Handler class as inner class of our class to handle the actions on the components in our class</p>
<p>Example :</p>
<p>File : CheckButtonTest.java</p>
<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
</pre></td><td class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">javax.swing.*</span><span style="color: #339933;">;</span>import <span style="color: #006699;">java.awt.*</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">java.awt.event.*</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #008000; font-style: italic; font-weight: bold;">/**
&nbsp;
*
&nbsp;
* @author ahmedabdelaliem
&nbsp;
*/</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> CheckBoxTest <span style="color: #000000; font-weight: bold;">extends</span> <span style="color: #003399;">JFrame</span><span style="color: #009900;">&#123;</span>
&nbsp;
<span style="color: #003399;">JCheckBox</span> b1,b2<span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// we create 2 referneces with JCheckBox type</span>
&nbsp;
<span style="color: #003399;">JTextField</span> t1<span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// we create 1 reference with JTextField type    // we create the constructor of the class</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">public</span> CheckBoxTest<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">//we call the constructor of our super class and give it the title of the frame</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">super</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Check Box Test&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">//now we setup the container</span>
&nbsp;
<span style="color: #003399;">Container</span> con <span style="color: #339933;">=</span> getContentPane<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
con.<span style="color: #006633;">setLayout</span><span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">FlowLayout</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;">// we create the text field object with pre entered text</span>
&nbsp;
t1 <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">JTextField</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;This is the test text&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// we set the font for the text field</span>
&nbsp;
t1.<span style="color: #006633;">setFont</span><span style="color: #009900;">&#40;</span> <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">Font</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;serif&quot;</span>, <span style="color: #003399;">Font</span>.<span style="color: #006633;">PLAIN</span>, <span style="color: #cc66cc;">14</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;">// now we add the text box to the container</span>
&nbsp;
con.<span style="color: #006633;">add</span><span style="color: #009900;">&#40;</span>t1<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// we create object for the checkbox and give it Bold value</span>
&nbsp;
b1 <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">JCheckBox</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Bold&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">//we add the checkbox to the container</span>
&nbsp;
con.<span style="color: #006633;">add</span><span style="color: #009900;">&#40;</span>b1<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// we create another object for the second box and give it italic value</span>
&nbsp;
b2 <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">JCheckBox</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Italic&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// we add the checkbox to the container</span>
&nbsp;
con.<span style="color: #006633;">add</span><span style="color: #009900;">&#40;</span>b2<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// now we create the handler object</span>
&nbsp;
Handler h <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> Handler<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;">// we add the handler as item listener for the 2 checkboxes</span>
&nbsp;
b1.<span style="color: #006633;">addItemListener</span><span style="color: #009900;">&#40;</span>h<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
b2.<span style="color: #006633;">addItemListener</span><span style="color: #009900;">&#40;</span>h<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// now we view the frame</span>
&nbsp;
setSize<span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">400</span>,<span style="color: #cc66cc;">300</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
setVisible<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// here we create the handler class   as inner class</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000000; font-weight: bold;">class</span> Handler <span style="color: #000000; font-weight: bold;">implements</span> <span style="color: #003399;">ItemListener</span><span style="color: #009900;">&#123;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000066; font-weight: bold;">int</span> bold <span style="color: #339933;">=</span> <span style="color: #003399;">Font</span>.<span style="color: #006633;">PLAIN</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// we setup initial values for the bold, italic variables</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000066; font-weight: bold;">int</span> italic <span style="color: #339933;">=</span> <span style="color: #003399;">Font</span>.<span style="color: #006633;">PLAIN</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// we overwrite the abstract method of the ItemListener interface</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> itemStateChanged<span style="color: #009900;">&#40;</span><span style="color: #003399;">ItemEvent</span> event<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>event.<span style="color: #006633;">getSource</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">==</span> b1<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span> <span style="color: #666666; font-style: italic;">// here we check which checkbox is checked</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>event.<span style="color: #006633;">getStateChange</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">==</span> event.<span style="color: #006633;">SELECTED</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span> <span style="color: #666666; font-style: italic;">// here we check if it is selected or the selection is removed</span>
&nbsp;
bold <span style="color: #339933;">=</span> <span style="color: #003399;">Font</span>.<span style="color: #006633;">BOLD</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// if conditions apply, we set the bold variable as BOLD</span>
&nbsp;
<span style="color: #666666; font-style: italic;">//t1.set;</span>
&nbsp;
<span style="color: #009900;">&#125;</span><span style="color: #000000; font-weight: bold;">else</span><span style="color: #009900;">&#123;</span>
&nbsp;
bold <span style="color: #339933;">=</span> <span style="color: #003399;">Font</span>.<span style="color: #006633;">PLAIN</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #009900;">&#125;</span>
&nbsp;
<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>event.<span style="color: #006633;">getSource</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">==</span> b2<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>event.<span style="color: #006633;">getStateChange</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">==</span> event.<span style="color: #006633;">SELECTED</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
&nbsp;
italic <span style="color: #339933;">=</span> <span style="color: #003399;">Font</span>.<span style="color: #006633;">ITALIC</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #009900;">&#125;</span><span style="color: #000000; font-weight: bold;">else</span><span style="color: #009900;">&#123;</span>
&nbsp;
italic <span style="color: #339933;">=</span> <span style="color: #003399;">Font</span>.<span style="color: #006633;">PLAIN</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// here we add the 2 variables and apply the format to our font</span>
&nbsp;
t1.<span style="color: #006633;">setFont</span><span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">Font</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Serif&quot;</span>, bold <span style="color: #339933;">+</span> italic, <span style="color: #cc66cc;">14</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>
<p>File : Main.java</p>
<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
</pre></td><td class="code"><pre class="java" style="font-family:monospace;"><span style="color: #008000; font-style: italic; font-weight: bold;">/**
&nbsp;
 *
&nbsp;
 * @author ahmedabdelaliem
&nbsp;
 */</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> Main <span style="color: #009900;">&#123;</span>    <span style="color: #008000; font-style: italic; font-weight: bold;">/**
&nbsp;
     * @param args the command line arguments
&nbsp;
     */</span>
&nbsp;
        <span style="color: #666666; font-style: italic;">// TODO code application logic here</span>
&nbsp;
        <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> main<span style="color: #009900;">&#40;</span><span style="color: #003399;">String</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> args<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
        <span style="color: #666666; font-style: italic;">// TODO code application logic here</span>
&nbsp;
       CheckBoxTest checkBox <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> CheckBoxTest<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
       checkBox.<span style="color: #006633;">setDefaultCloseOperation</span><span style="color: #009900;">&#40;</span>CheckBoxTest.<span style="color: #006633;">EXIT_ON_CLOSE</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>
<p>This method is better than the first one, cause it allow us to create one handler for many objects and the handler can reach and compare the variables of our main class.</p>
<p>The third method is to create an instance of</p>
]]></content:encoded>
			<wfw:commentRss>http://www.php-architect.com/blog/2008/01/09/action-event-handling-in-java/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

