<?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>Compiled Thoughts by John Ciacia &#187; PHP</title>
	<atom:link href="http://www.johnciacia.com/category/tutorial/php-tutorial/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.johnciacia.com</link>
	<description>Science, Technology, and Beyond</description>
	<lastBuildDate>Fri, 06 Jan 2012 15:46:22 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>No require with autoload</title>
		<link>http://www.johnciacia.com/2011/01/02/no-require-with-autoload/</link>
		<comments>http://www.johnciacia.com/2011/01/02/no-require-with-autoload/#comments</comments>
		<pubDate>Sun, 02 Jan 2011 21:57:27 +0000</pubDate>
		<dc:creator>John</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[autoload]]></category>
		<category><![CDATA[framework]]></category>
		<category><![CDATA[namespace]]></category>
		<category><![CDATA[php5]]></category>
		<category><![CDATA[php6]]></category>
		<category><![CDATA[require]]></category>

		<guid isPermaLink="false">http://www.johnciacia.com/?p=734</guid>
		<description><![CDATA[If you have ever worked with a PHP framework you probably have noticed some features that allow you to develop code more rapidly. In this blog, I am going to address autoloading. Traditionally, in object oriented PHP, we create a new source file for each class. If we want to create an object of a [...]]]></description>
			<content:encoded><![CDATA[<p>If you have ever worked with a PHP framework you probably have noticed some features that allow you to develop code more rapidly. In this blog, I am going to address autoloading.</p>
<p>Traditionally, in object oriented PHP, we create a new source file for each class. If we want to create an object of a class, we have to include the php file using require_once (or using a similar function). If we do not include the source file, we will be issued a fatal error.</p>
<p>
<pre><strong>Fatal error</strong>: Class 'User' not found in ...</pre>
</p>
<p>Lets say we have a User class defined as follows in a User.php file</p>
<p>[code lang="PHP"]<?php</p>
<p>class User {<br />
    function __construct() {<br />
        echo "Hello, World!";<br />
    }<br />
}<br />
?>[/code]</p>
<p>If we want to create a new User object we would include user.php and use the new keyword to instantiate the class.</p>
<p>[code lang="PHP"]<?php<br />
require_once('user.php');<br />
$user = new User();[/code]</p>
<p>This is method reasonable for a small number of classes. However, large frameworks can span hundreds of classes, and having to write require_once for each class becomes a huge annoyance. PHP5 introduced an autoload <a href="http://php.net/manual/en/language.oop5.magic.php">magic method</a> which is automatically called if the class source file cannot be found. The __autoload function takes a single parameter - the class being instantiated. If our class name corresponds to its file name we can do something as simple as:</p>
<p>[code lang="PHP"]<?php<br />
function __autoload($class) {<br />
    require_once($class . ".php");<br />
}[/code]</p>
<p>Now, each time you instantiate a class, the autoload function will be automatically ran and it will automagically require your class. This is great, however all classes have to be in the same directory as the callee, and any decent framework uses a class hierarchy and spreads classes out into different directories. When I was writing my framework a few years ago, I stumbled upon a pretty awesome use of the autoload function. I think the idea was borrowed from the Zend framework. In a nutshell, the class names would correspond to their location on the file system. For example, the Zend framework has a class named Zend_Controller_Action_HelperBroker, and the class path Zend/Controller/Action/HelperBroker.php. What does this mean? With some additional code in our autoload function, we can convert the class name into its respective path allowing use to create a class hierarchy on our file system.</p>
<p>[code lang="PHP"]<?php<br />
function __autoload($class) {<br />
    $file = str_replace("_", "/", $class);<br />
    require_once($file . ".php");<br />
}[/code]</p>
<p>Now, with the onset of PHP5.3 and the introduction of namespaces, this method has been kind of depreciated for a more pragmatic method. Instead of naming our classes with really long names that correspond to their path, we can use a namespace instead. Thus our autoload function would look like:</p>
<p>[code lang="PHP"]<?php<br />
function __autoload($class) {<br />
    $file = str_replace("\\", "/", $class);<br />
    require_once($file . ".php");<br />
}[/code]</p>
<p>In my next blog, I will talk more about namespaces and give a better demo on how this is used.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.johnciacia.com/2011/01/02/no-require-with-autoload/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Sending Text Messages in PHP</title>
		<link>http://www.johnciacia.com/2010/08/07/sending-text-messages-in-php/</link>
		<comments>http://www.johnciacia.com/2010/08/07/sending-text-messages-in-php/#comments</comments>
		<pubDate>Sat, 07 Aug 2010 17:15:05 +0000</pubDate>
		<dc:creator>John</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[mail]]></category>
		<category><![CDATA[sms]]></category>

		<guid isPermaLink="false">http://www.johnciacia.com/?p=648</guid>
		<description><![CDATA[Recently I&#8217;ve had to implement an alert system in PHP were the alerts are sent via a text message. The concept is very simple &#8211; use an email to SMS gateway. Essentially, you send an email to a phone companies gateway server, that server then relays the email to the phone number specified via a [...]]]></description>
			<content:encoded><![CDATA[<p>Recently I&#8217;ve had to implement an alert system in PHP were the alerts are sent via a text message. The concept is very simple &#8211; use an email to SMS gateway. Essentially, you send an email to a phone companies gateway server, that server then relays the email to the phone number specified via a SMS. Since PHP has the ability to send emails, the whole process is quite easy.</p>
<p>1. First you need to acquire a list of SMS gateways you are going to support. For an extensive list, check out Wikipedias <a href="http://en.wikipedia.org/wiki/List_of_carriers_providing_SMS_transit">List of SMS Gateways</a>. For this tutorial, I will only be using AT&#038;T Wireless (number@txt.att.net) and Verison (number@vtext.com).</p>
<p>2. Create a simple HTML form.<br />
[code lang="html"]<!DOCTYPE html><br />
<html><br />
<head><br />
	<meta charset="utf-8"></meta></p>
<p></head></p>
<p><body></p>
<form action="POST">
<p>		<label for="provider">Provider: </label></p>
<select>
<option value="txt.att.net">AT&#038;T Wireless</option>
<option value="vtext.com">Verizon</option>
</select>
<p></p>
<p>		<label for="number">Number: </label></p>
<input type="number" /></p>
<p>		<label for="subject">Subject: </label></p>
<input type="subject" /></p>
<p>		<label for="message">Message: </label></p>
<input type="message" /></p>
<input type="submit" /></form>
<p></body></p>
<p></html><br />
[/code]</p>
<p>3. Add the necessary PHP code to send the email<br />
[code lang="PHP"]<!DOCTYPE html><br />
<html><br />
<head><br />
	<meta charset="utf-8"></meta></p>
<p></head></p>
<p><body><br />
	<?php<br />
		if(!empty($_POST['number'])) {<br />
			mail($_POST['number'] . $_POST['provider'], $_POST['subject'], $_POST['message']);<br />
        }<br />
	?></p>
<form action="POST">
<p>		<label for="provider">Provider: </label></p>
<select>
<option value="@txt.att.net">AT&#038;T Wireless</option>
<option value="@vtext.com">Verizon</option>
</select>
<p></p>
<p>		<label for="number">Number: </label></p>
<input type="number" /></p>
<p>		<label for="subject">Subject: </label></p>
<input type="subject" /></p>
<p>		<label for="message">Message: </label></p>
<input type="message" /></p>
<input type="submit" /></form>
<p></body></p>
<p></html><br />
[/code]</p>
<p>You will want to do some better error checking and validation, but thats it!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.johnciacia.com/2010/08/07/sending-text-messages-in-php/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Grayscale Images with GD</title>
		<link>http://www.johnciacia.com/2010/01/18/grayscale-images-with-gd/</link>
		<comments>http://www.johnciacia.com/2010/01/18/grayscale-images-with-gd/#comments</comments>
		<pubDate>Tue, 19 Jan 2010 02:38:06 +0000</pubDate>
		<dc:creator>John</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Tutorial]]></category>

		<guid isPermaLink="false">http://www.johnciacia.com/?p=679</guid>
		<description><![CDATA[In computing, a grayscale or greyscale digital image is an image in which the value of each pixel is a single sample, that is, it carries the full (and only) information about its intensity. Images of this sort are composed exclusively of shades of neutral gray, varying from black at the weakest intensity to white [...]]]></description>
			<content:encoded><![CDATA[<blockquote><p>In computing, a grayscale or greyscale digital image is an image in which the value of each pixel is a single sample, that is, it carries the full (and only) information about its intensity. Images of this sort are composed exclusively of shades of neutral gray, varying from black at the weakest intensity to white at the strongest.</p></blockquote>
<p>In PHP, it is easy enough to do. First we want to create two image resources. First we need our original image so we can map its color. Second we need to create an image which will become our grayscale image.</p>
<p>[code lang="php"]<?php<br />
//change this to your image location<br />
$original = @imagecreatefrompng("/home/john/Documents/colorized.png")<br />
    or die("Cannot Initialize new GD image stream");</p>
<p>$im = @imagecreate(imagesx($original), imagesy($original))<br />
    or die("Cannot Initialize new GD image stream");<br />
[/code]</p>
<p>Next we want to create our color pallet. Since we our goal is a gray image,we will only use shades of black and white. Colorized images are generally within the RGB color space. Meaning each pixel is composed of red, green, and blue light which allows you to reproduce a broad array of colors. White is represented as 255,255,255 and black is represented as 0,0,0. Therefore, all gray shades are represented as x,x,x. So we thus create our pallet:<br />
[code lang="php"]<?php<br />
for ($i = 0; $i <= 255; $i++) {<br />
    $palette[$i] = imagecolorallocate($im, $i, $i, $i);<br />
}[/code]</p>
<p>Next we want to create a function to convert from the RGB color space to some color space that only represents the pixels intensity. The <a href="http://en.wikipedia.org/wiki/YIQ">YIQ</a> is the best color space for this since the Y represents the luma of the pixel. The numbers I use in the function below comes from the Y component: <a href="http://en.wikipedia.org/wiki/YIQ#Formulas">YIQ - Wikipedia, the free encyclopedia</a><br />
[code lang="php"]<?php<br />
function grayscale($r, $g, $b) {<br />
    return 0.299*$r + 0.587*$g + 0.114*$b;<br />
}[/code]</p>
<p>Now we actually need to get the RGB values of each pixel so we can convert if. To do this, we iterate over the entire image (so large images will take some time), and place the transformed pixel onto the new image we wish to create.</p>
<p>[code lang="php"]<?php<br />
for($x = 0; $x < imagesx($original); $x++) {<br />
    for($y = 0; $y < imagesy($original); $y++) {<br />
        $rgb = imagecolorat($original, $x, $y);<br />
        $r = ($rgb >> 16) &#038; 0xFF;<br />
        $g = ($rgb >> <img src='http://www.johnciacia.com/wp-includes/images/smilies/icon_cool.gif' alt='8)' class='wp-smiley' /> &#038; 0xFF;<br />
        $b = $rgb &#038; 0xFF;<br />
        imagesetpixel($im, $x, $y, $palette[grayscale($r, $g, $b)]);<br />
    }<br />
}[/code]</p>
<p>Now all that is left is to set the header and create the image. The final code is below.</p>
<p>[code lang="php"]<?php<br />
header("Content-type: image/png");</p>
<p>$original = @imagecreatefrompng("/home/john/Documents/colorized.png")<br />
    or die("Cannot Initialize new GD image stream");</p>
<p>$im = @imagecreate(imagesx($original), imagesy($original))<br />
    or die("Cannot Initialize new GD image stream");</p>
<p>for ($i = 0; $i <= 255; $i++) {<br />
    $palette[$i] = imagecolorallocate($im, $i, $i, $i);<br />
}</p>
<p>function grayscale($r, $g, $b) {<br />
    return 0.299*$r + 0.587*$g + 0.114*$b;<br />
}</p>
<p>for($x = 0; $x < imagesx($original); $x++) {<br />
    for($y = 0; $y < imagesy($original); $y++) {<br />
        $rgb = imagecolorat($original, $x, $y);<br />
        $r = ($rgb >> 16) &#038; 0xFF;<br />
        $g = ($rgb >> <img src='http://www.johnciacia.com/wp-includes/images/smilies/icon_cool.gif' alt='8)' class='wp-smiley' /> &#038; 0xFF;<br />
        $b = $rgb &#038; 0xFF;<br />
        imagesetpixel($im, $x, $y, $palette[grayscale($r, $g, $b)]);<br />
    }<br />
}</p>
<p>imagepng($im);<br />
imagedestroy($im);<br />
?>[/code]</p>
<p>Attached is an example of a colorized image (left) and the same image using the above code (right)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.johnciacia.com/2010/01/18/grayscale-images-with-gd/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Getting to know GD</title>
		<link>http://www.johnciacia.com/2010/01/04/getting-to-know-gd/</link>
		<comments>http://www.johnciacia.com/2010/01/04/getting-to-know-gd/#comments</comments>
		<pubDate>Mon, 04 Jan 2010 22:50:06 +0000</pubDate>
		<dc:creator>John</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Tutorial]]></category>

		<guid isPermaLink="false">http://www.johnciacia.com/?p=434</guid>
		<description><![CDATA[Create dynamic userbars with GD Introduction: Have you ever been on aim and received a message from one of your friends with a big long URL followed by something like &#8220;John%20Is%20Stupid.&#8221; You know what ever it is, wont be worth your time, but you click on it anyway to find someone goofy looking holding a [...]]]></description>
			<content:encoded><![CDATA[<h2>Create dynamic userbars with GD</h2>
<p><strong>Introduction:</strong><br />
Have you ever been on aim and received a message from one of your friends with a big long URL followed by something like &#8220;John%20Is%20Stupid.&#8221; You know what ever it is, wont be worth your time, but you click on it anyway to find someone goofy looking holding a sign and on it printed in big bold letters &#8220;John Is Stupid.&#8221; Ever wonder how they work? Chances are, the script takes advantage of the GD functions. In this tutorial you will learn many GD functions that you can use to generate images. The goal for this tutorial is for you to generate a dynamic user bar.</p>
<p>Here is a list of the functions used in this tutorial:</p>
<ol>
<li><a href="http://us3.php.net/manual/en/function.header.php">header()</a></li>
<li><a href="http://us3.php.net/manual/en/function.imagecolorallocate.php">imagecolorallocate()</a></li>
<li><a href="http://us3.php.net/manual/en/function.imagettfbbox.php">imagettfbbox()</a></li>
<li><a href="http://us3.php.net/manual/en/function.imagesx.php">imagesx()</a></li>
<li><a href="http://us3.php.net/manual/en/function.abs.php">abs()</a></li>
<li><a href="http://us3.php.net/manual/en/function.imagettftext.php">imagettftext()</a></li>
<li><a href="http://us3.php.net/manual/en/function.imagepng.php">imagepng()</a></li>
<li><a href="http://us3.php.net/manual/en/function.imagedestroy.php">imagedestroy()</a></li>
</ol>
<p>The first thing you want to do is create the header type using the header function. Next you use the GD tools to create an image from a png file. In my case, I have userbar.png in the same directory as this script is in. The function imagecolorallocate creates a color using RGB (red-green-blue) format. The next three lines just set some basic information which isn’t that hard to understand. The last three lines to must of the work creating the image. The most important function here to pay attention to is imagettftext. The imagettftext requires 8 arguments which are the resource image, font size, the angle, x location, y location, font color, the actual font, and the string to be printed.</p>
<p>[code lang="php"]<?php<br />
    header('Content-type: image/png');<br />
    $im = imagecreatefrompng ("userbar.png");<br />
    $color = imagecolorallocate($im, 0, 0, 0);<br />
    $text = "test";<br />
    $font = 'font.ttf';<br />
    $size = 8;<br />
    imagettftext($im, $size, 0, 15, 12, $color, $font, $text);<br />
    imagepng($im);<br />
    imagedestroy($im);<br />
?>[/code]</p>
<p>Now that we have GD generating an image, lets make it a little more complex. We&#8217;ve added the<br />
[code lang="php"]$text = $_GET['text'];[/code]<br />
line to allow the user to enter a random string, and we have also added the<br />
[code lang="php"]$size = imagettfbbox($fontsize, 0, $font, $text);<br />
$dx = (imagesx($im)) - (abs($size[2]-$size[0])) - 20;<br />
[/code]<br />
Which calculate where to start printing the string on the image. The function imagettfbbox generates the length of the font string in pixels. If you were to use something like strlen($text) that would just return the number of characters in the string, which isn’t very usefull in this case. Next, we use the imagesx() function to determine the width of the image, we take that value and subtract the string length in pixels and subtract an extra 20 pixels to leave some room toward the end of the image.<br />
[code lang="php"]<?php<br />
    header('Content-type: image/png');<br />
    $text = $_GET['text'];<br />
    $im = imagecreatefrompng ("userbar.png");<br />
    $color = imagecolorallocate($im, 0, 0, 0);<br />
    $font = 'font.ttf';<br />
    $fontsize = 6;<br />
    $size = imagettfbbox($fontsize, 0, $font, $text); //calculate the pixel of the string<br />
    $dx = (imagesx($im)) - (abs($size[2]-$size[0])) - 20; //calculate the location to start the text<br />
    imagettftext($im, $fontsize, 0, $dx, 13, $color, $font, $text);<br />
    imagepng($im);<br />
    imagedestroy($im);<br />
?><br />
[/code]</p>
<p>At this point you could call yourself done. However you could add some extra features such as make the font color vary with the user input. Adding a simple if statement will accomplish this.</p>
<p>[code lang="PHP"]<?php<br />
    header('Content-type: image/png');<br />
    $text = $_GET['text'];</p>
<p>    $im = imagecreatefrompng ("userbar.png");</p>
<p>    if($text == "ADMINISTRATOR"){ //if administrator<br />
        $color = imagecolorallocate($im, 255, 0, 0); //red<br />
    }<br />
    else if($text == "MODERATOR"){ //if moderator<br />
        $color = imagecolorallocate($im, 0, 0, 255); //blue<br />
    }<br />
    else if($text == "JUNKIE"){ //if junkie<br />
        $color = imagecolorallocate($im, 0, 0, 0); //black<br />
    }<br />
    else { //something else...<br />
        $color = imagecolorallocate($im, 0, 128, 0); //green<br />
    }</p>
<p>    $font = 'font.ttf'; //font file<br />
    $fontsize = 6; //font size<br />
    $stringsize = imagettfbbox($fontsize, 0, $font, $text); //calculate the pixel of the string<br />
    $dx = (imagesx($im)) - (abs($stringsize[2]-$stringsize[0])) - 20; //calculate the location to start the text<br />
    imagettftext($im, $fontsize, 0, $dx, 13, $color, $font, $text);<br />
    imagepng($im);<br />
    imagedestroy($im);<br />
?><br />
[/code]</p>
<p>Finally you can save this script as generator.php and display it in forums by using the html tags.</p>
<div class="quote">&lt;img src=&quot;http://www.yourdomain.com/generator.php?text=JUNKIE&quot; /&gt;</div>
]]></content:encoded>
			<wfw:commentRss>http://www.johnciacia.com/2010/01/04/getting-to-know-gd/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>HTML with Swing Components</title>
		<link>http://www.johnciacia.com/2009/08/01/html-with-swing-components/</link>
		<comments>http://www.johnciacia.com/2009/08/01/html-with-swing-components/#comments</comments>
		<pubDate>Sat, 01 Aug 2009 16:21:38 +0000</pubDate>
		<dc:creator>John</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[swing]]></category>

		<guid isPermaLink="false">http://www.johnciacia.com/?p=573</guid>
		<description><![CDATA[One useful feature of Swing GUI&#8217;s many people overlook is the ability to use simple HTML tags within swing components. This tutorial assumes you know how to create a GUI in swing and add components. If you do not know how to do this, it is a good idea to read one of my previous [...]]]></description>
			<content:encoded><![CDATA[<p>One useful feature of Swing GUI&#8217;s many people overlook is the ability to use simple HTML tags within swing components. This tutorial assumes you know how to create a GUI in swing and add components. If you do not know how to do this, it is a good idea to read one of my previous tutorials.</p>
<p>Lets first create a basic GUI with a JButton and JLabel:</p>
<p>[code lang="java"]package tutorials;</p>
<p>import javax.swing.JButton;<br />
import javax.swing.JFrame;<br />
import javax.swing.JLabel;</p>
<p>public class HTMLJButton {</p>
<p>	public HTMLJButton(){<br />
		JFrame mainFrame = new JFrame("HTML");<br />
		mainFrame.setLayout(new java.awt.FlowLayout());</p>
<p>		JButton button1 = new JButton("JButton Text");<br />
		JLabel label1 = new JLabel("JLabel Text");</p>
<p>		mainFrame.add(button1);<br />
		mainFrame.add(label1);</p>
<p>		mainFrame.setDefaultCloseOperation(mainFrame.EXIT_ON_CLOSE);<br />
		mainFrame.setVisible(true);<br />
		mainFrame.pack();<br />
	}</p>
<p>	public static void main(String[] args){<br />
		new HTMLJButton();<br />
	}<br />
}[/code]</p>
<p>But what if you want the text on the button to be a different color? You can use the HTML font tags inside the JButton string parameter.</p>
<p>Such as:<br />
[code lang="java"]JLabel label1 = new JLabel("<html><font color='#FF0000'>Red Text</font>" +<br />
		"<br /><font color='#00FF00'>Blue Text</font></html>");[/code]</p>
<p>Not only can you modify fonts, you can also insert images:<br />
[code lang="java"]JLabel label1 = new JLabel("<html><img src='http://www.google.com/intl/en_ALL/images/logo.gif'></img></html>");[/code]</p>
<p>There is much more you can do with HTML, just note, when you do insert HTML into a componnents string paramater, you need to surround the HTML with the opening and closing HTML tags <html></html> and you need to use single quotes since the entire string is bound by double quotes.</p>
<p>[code lang="java"]package tutorials;</p>
<p>import javax.swing.JButton;<br />
import javax.swing.JFrame;<br />
import javax.swing.JLabel;</p>
<p>public class HTMLJButton {</p>
<p>	public HTMLJButton(){<br />
		JFrame mainFrame = new JFrame("HTML");<br />
		mainFrame.setLayout(new java.awt.FlowLayout());</p>
<p>		JButton button1 = new JButton("<html><font color='#FF0000'>JButton Text</font></html>");<br />
		JLabel label1 = new JLabel("<html><font color='#FF0000'>Red Text</font>" +<br />
				"<br /><font color='#00FF00'>Blue Text</font>" +<br />
				"<br /><font color='#0000FF'>Green Text</font>" +<br />
				"<br /><font color='#000000'>Black Text</font>" +<br />
				"<br /><font color='#FFFFFF'>Blue Text</font></html>");</p>
<p>		mainFrame.add(button1);<br />
		mainFrame.add(label1);</p>
<p>		mainFrame.setDefaultCloseOperation(mainFrame.EXIT_ON_CLOSE);<br />
		mainFrame.setVisible(true);<br />
		mainFrame.pack();<br />
	}</p>
<p>	public static void main(String[] args){<br />
		new HTMLJButton();<br />
	}<br />
}[/code]</p>
]]></content:encoded>
			<wfw:commentRss>http://www.johnciacia.com/2009/08/01/html-with-swing-components/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Page Caching using disk: enhanced

Served from: www.johnciacia.com @ 2012-02-05 11:39:13 -->
