<?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>KodeGeek &#187; swing</title>
	<atom:link href="http://kodegeek.com/blog/tag/swing/feed/" rel="self" type="application/rss+xml" />
	<link>http://kodegeek.com/blog</link>
	<description>Programación, fitness, interés geek</description>
	<lastBuildDate>Sun, 29 Apr 2012 17:29:57 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>JavaFX Script ha muerto, Swing aún sigue en pie</title>
		<link>http://kodegeek.com/blog/2010/09/21/javafx-script-ha-muerto-swing-aun-sigue-en-pie/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=javafx-script-ha-muerto-swing-aun-sigue-en-pie</link>
		<comments>http://kodegeek.com/blog/2010/09/21/javafx-script-ha-muerto-swing-aun-sigue-en-pie/#comments</comments>
		<pubDate>Tue, 21 Sep 2010 11:33:40 +0000</pubDate>
		<dc:creator>josevnz</dc:creator>
				<category><![CDATA[java]]></category>
		<category><![CDATA[jafavx]]></category>
		<category><![CDATA[javafx is dead]]></category>
		<category><![CDATA[javaone]]></category>
		<category><![CDATA[oracle]]></category>
		<category><![CDATA[swing]]></category>

		<guid isPermaLink="false">http://kodegeek.com/blog/?p=2603</guid>
		<description><![CDATA[Bueno, es un cambio de tono que no esperaba. En JavaOne de este año anunciaron que JavaFX Script está muerto y en va a tener integración desde Swing y otros lenguajes dinámicos. Las mentadas de madre no se hicieron esperar en Twitter y otros lados el día de hoy. Después de todo son 3 años [...]]]></description>
			<content:encoded><![CDATA[<p> Bueno, es un cambio de tono que no esperaba. En <a href="http://java.dzone.com/articles/oracle-discontinue-javafx">JavaOne de este año anunciaron que JavaFX Script</a> está muerto y en va a tener integración desde Swing y otros lenguajes dinámicos.</p>
<p><a href="http://twitter.com/search?q=%23javafx">Las mentadas de madre</a> no se hicieron esperar en Twitter y otros lados el día de hoy. Después de todo son 3 años en los cuales un producto se vuelve a reiniciar (yo me cuento entre quienes perdieron el tiempo leyendo sobre JavaFX). Por otro lado, Java Swing necesita mejoras pronto y quizas esta es la mejor decisión.</p>
<p>Como que alguien en Oracle se dio cuenta que la inversión en Swing de tantos años no se puede botar a la basura, sin embargo queda por verse si vale la pena invertir el tiempo en <a href="http://javafx.com/roadmap/">JavaFX antes de la versión 2.0</a> (apenas estamos en 1.3, la cual tiene todavía muchos huecos).</p>
<p>¿Quiere más detalles (código)? <a href="http://steveonjava.com/javafx-2-0/">Aquí</a> tienen una muestra de lo que viene&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://kodegeek.com/blog/2010/09/21/javafx-script-ha-muerto-swing-aun-sigue-en-pie/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Como enviar Tweets desde Java usando Twitter4J</title>
		<link>http://kodegeek.com/blog/2009/07/05/como-enviar-tweets-desde-java-usando-twitter4j/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=como-enviar-tweets-desde-java-usando-twitter4j</link>
		<comments>http://kodegeek.com/blog/2009/07/05/como-enviar-tweets-desde-java-usando-twitter4j/#comments</comments>
		<pubDate>Sun, 05 Jul 2009 12:43:12 +0000</pubDate>
		<dc:creator>josevnz</dc:creator>
				<category><![CDATA[java]]></category>
		<category><![CDATA[kodegeek]]></category>
		<category><![CDATA[opensource]]></category>
		<category><![CDATA[programación]]></category>
		<category><![CDATA[stupidzombie]]></category>
		<category><![CDATA[swing]]></category>
		<category><![CDATA[twitter]]></category>
		<category><![CDATA[twitter4j]]></category>
		<category><![CDATA[twitterping]]></category>

		<guid isPermaLink="false">http://kodegeek.com/blog/?p=1940</guid>
		<description><![CDATA[Una de las cosas que quiero hacer para la versión 1.1 de StupidZombie es agregarle soporte para actualizar el estado de Twitter cada vez que hacemos un ping. Como siempre es el asunto de construir algo desde cero o utilizar una herramienta existente y en el caso de StupidZombie lo que quiero es implementar la [...]]]></description>
			<content:encoded><![CDATA[<p>Una de las cosas que quiero hacer para la versión 1.1 de StupidZombie es agregarle soporte para actualizar el estado de Twitter cada vez que hacemos un ping. Como siempre es el asunto de construir algo desde cero o utilizar una herramienta existente y en el caso de StupidZombie lo que quiero es implementar la funcionalidad lo más rápido posible (por ejemplo, no tengo tiempo para seguir los cambios en el<a href="http://apiwiki.twitter.com/FAQ"> API</a> de Twitter).</p>
<p>Después de <a href="http://apiwiki.twitter.com/Libraries#Javanbsp">buscar en la red</a> me conseguí que <a href="http://yusuke.homeip.net/twitter4j/en/index.html">Twitter4J </a>es quizas la versión más madura para Java (recuerden, StupidZombie está escrito en ese lenguaje). Ni corto ni perezoso me puse a echar código y al final me decidí escribir una pequeña aplicación en Swing la cual hace lo siguiente:</p>
<ol>
<li>Autoriza la aplicación contra su cuenta de Twitter</li>
<li>Obtiene un PIN y claves especiales de autorización (lo cual no es lo mismo que su usuario clave, a eso se le conoce como<a href="http://apiwiki.twitter.com/Authentication"> OAuth</a>).</li>
<li>Envia un mensaje (tweet) a su cuenta en Twitter desde la aplicación en Java</li>
</ol>
<p>Nota, si usted es el desarrollador de la aplicación entonces lo primero que hay que hacer <a href="http://twitter.com/oauth_clients/new">es registrar una aplicación nueva</a> en Twitter (sus usuarios pueden saltarse este paso). Una vez terminado se ve como lo siguiente:</p>
<p><a href="http://www.flickr.com/photos/josevnz/3689339643/" title="Registered applications by josevnz, on Flickr"><img src="http://farm4.static.flickr.com/3588/3689339643_c64de4f818.jpg" width="500" height="345" alt="Registered applications" /><br />
Aplicaciones registradas en Twitter</a></p>
<p>Una vez registrada debemos pasar &#8220;Consumer key&#8221; y &#8220;Consumer Secret&#8221; a nuestro código de Twitter4j, yo lo hago en el constructor:</p>

<div class="wp_codebox"><table><tr id="p19405"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
</pre></td><td class="code" id="p1940code5"><pre class="java" style="font-family:monospace;">	<span style="color: #000000; font-weight: bold;">private</span> TwitterPing<span style="color: #009900;">&#40;</span><a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">String</span></a> consumerKey, <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">String</span></a> consumerSecret<span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">throws</span> TwitterException <span style="color: #009900;">&#123;</span>
		<span style="color: #000000; font-weight: bold;">super</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;KodeGeek simple Twitter pinger&quot;</span><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>consumerKey <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;">throw</span> <span style="color: #000000; font-weight: bold;">new</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Aillegalargumentexception+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">IllegalArgumentException</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Consumer key is missing&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
		<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>consumerSecret <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;">throw</span> <span style="color: #000000; font-weight: bold;">new</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Aillegalargumentexception+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">IllegalArgumentException</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Consumer secret is missing&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
		twitter <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> Twitter<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		twitter.<span style="color: #006633;">setOAuthConsumer</span><span style="color: #009900;">&#40;</span>consumerKey, consumerSecret<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		requestToken <span style="color: #339933;">=</span> twitter.<span style="color: #006633;">getOAuthRequestToken</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
		setPreferredSize<span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Adimension+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">Dimension</span></a><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">600</span>, <span style="color: #cc66cc;">400</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></pre></td></tr></table></div>

<p>Desde la aplicación en Swing hacemos clic en el botón que dice &#8220;Authorize KodeGeek on Tweeter&#8221;. Si el soporte de Java para escritorio está activado entonces el navegador por omisión se arrancará e iremos a Twitter:</p>
<p><a href="http://www.flickr.com/photos/josevnz/3689301415/" title="Allowing KodeGeek by josevnz, on Flickr"><img src="http://farm3.static.flickr.com/2501/3689301415_dd8242c8c1.jpg" width="500" height="233" alt="Allowing KodeGeek" /><br />
Hora de autorizar a KodeGeek <img src='http://kodegeek.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </a></p>
<p>El código que hace esto es super sencillo :</p>

<div class="wp_codebox"><table><tr id="p19406"><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
</pre></td><td class="code" id="p1940code6"><pre class="java" style="font-family:monospace;">	<span style="color: #008000; font-style: italic; font-weight: bold;">/**
	 * Send the user to the authorization webpage
	 * @throws Exception 
	 */</span>
	<span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000066; font-weight: bold;">void</span> sendUserToAuthUrl<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">throws</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Aexception+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">Exception</span></a> <span style="color: #009900;">&#123;</span>
		<span style="color: #000000; font-weight: bold;">final</span> TwitterPing instance <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">this</span><span style="color: #339933;">;</span>
		log.<span style="color: #006633;">log</span><span style="color: #009900;">&#40;</span>Level.<span style="color: #006633;">INFO</span>, <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">String</span></a>.<span style="color: #006633;">format</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Got authorization URL: %s&quot;</span>, requestToken.<span style="color: #006633;">getAuthorizationURL</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><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>Desktop.<span style="color: #006633;">isDesktopSupported</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>
			Desktop.<span style="color: #006633;">getDesktop</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">browse</span><span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> URI<span style="color: #009900;">&#40;</span>requestToken.<span style="color: #006633;">getAuthorizationURL</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			log.<span style="color: #006633;">info</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Redirection was successfull.&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">else</span> <span style="color: #009900;">&#123;</span>
			<a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Aeventqueue+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">EventQueue</span></a>.<span style="color: #006633;">invokeLater</span><span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Arunnable+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">Runnable</span></a><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
				@Override
				<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>
					<a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Ajoptionpane+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">JOptionPane</span></a>.<span style="color: #006633;">showMessageDialog</span><span style="color: #009900;">&#40;</span>
							instance, 
							<a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">String</span></a>.<span style="color: #006633;">format</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Cannot call default browser, please go to this URL instead: %s&quot;</span>, requestToken.<span style="color: #006633;">getAuthorizationURL</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>, 
							<span style="color: #0000ff;">&quot;Problems trying to send the user to default page&quot;</span>, 
							<a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Ajoptionpane+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">JOptionPane</span></a>.<span style="color: #006633;">ERROR_MESSAGE</span><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;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
	<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>Si la autorización es aceptada (como se ve a continuación):</p>
<p><a href="http://www.flickr.com/photos/josevnz/3690106764/" title="KodeGeek twitter application by josevnz, on Flickr"><img src="http://farm3.static.flickr.com/2655/3690106764_7da7b4e8b9.jpg" width="500" height="248" alt="KodeGeek twitter application" /><br />
La autorización trabajó</a></p>
<p>Entonces podemos pedir el token de acceso usando el PIN obtenido en el paso anterior:</p>

<div class="wp_codebox"><table><tr id="p19407"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
</pre></td><td class="code" id="p1940code7"><pre class="java" style="font-family:monospace;">	<span style="color: #008000; font-style: italic; font-weight: bold;">/**
	 * Call this method only after the user has authorized the application
	 * @throws TwitterException 
	 */</span>
	<span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000066; font-weight: bold;">void</span> getAccessToken<span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">final</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">String</span></a> pin<span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">throws</span> TwitterException <span style="color: #009900;">&#123;</span>
		log.<span style="color: #006633;">info</span><span style="color: #009900;">&#40;</span><a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">String</span></a>.<span style="color: #006633;">format</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Got token: %s, Got secret: %s&quot;</span>, requestToken.<span style="color: #006633;">getToken</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>, requestToken.<span style="color: #006633;">getTokenSecret</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		accessToken <span style="color: #339933;">=</span> twitter.<span style="color: #006633;">getOAuthAccessToken</span><span style="color: #009900;">&#40;</span>requestToken, pin<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>accessToken <span style="color: #339933;">!=</span> <span style="color: #000066; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span>
			log.<span style="color: #006633;">info</span><span style="color: #009900;">&#40;</span><a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">String</span></a>.<span style="color: #006633;">format</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Got access token for user %s&quot;</span>, accessToken.<span style="color: #006633;">getScreenName</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>Lo cual se ve así:</p>
<p><a href="http://www.flickr.com/photos/josevnz/3689301437/" title="Ping number, required for desktop apps by josevnz, on Flickr"><img src="http://farm4.static.flickr.com/3596/3689301437_0ca4439ae5.jpg" width="500" height="211" alt="Ping number, required for desktop apps" />Número PIN para darle acceso a nuestro cliente a la cuenta de Twitter</a></p>
<p>Si todo va bien entonces podemos mostrar los 3 pedazos de la autorización necesarios para poder enviar un Tweet:</p>
<p><a href="http://www.flickr.com/photos/josevnz/3690106810/" title="After geting the auth tokens by josevnz, on Flickr"><img src="http://farm3.static.flickr.com/2450/3690106810_47832ab3b5.jpg" width="500" height="333" alt="After geting the auth tokens" /><br />
La aplicación tiene todo lo que necesita. Hora  de enviar un tweet</a></p>
<p>Ya hacer el tweet es trivial con el siguiente pedazo de código:</p>

<div class="wp_codebox"><table><tr id="p19408"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
</pre></td><td class="code" id="p1940code8"><pre class="java" style="font-family:monospace;">	<span style="color: #008000; font-style: italic; font-weight: bold;">/**
	 * Send a tween using an existing AccessToken
	 * @param tweet The update to set
	 * @throws TwitterException If there is a problem updating the status
	 * @return The status of the tweet
	 */</span>
	<span style="color: #000000; font-weight: bold;">private</span> Status sendTweet<span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">final</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">String</span></a> tweet<span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">throws</span> TwitterException <span style="color: #009900;">&#123;</span>
		twitter.<span style="color: #006633;">setOAuthAccessToken</span><span style="color: #009900;">&#40;</span>accessToken<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #000000; font-weight: bold;">return</span> twitter.<span style="color: #006633;">updateStatus</span><span style="color: #009900;">&#40;</span>tweet<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>Al final, ¡exito!:</p>
<p><a href="http://www.flickr.com/photos/josevnz/3689301475/" title="Success, tweet update by josevnz, on Flickr"><img src="http://farm3.static.flickr.com/2581/3689301475_855e82d83e.jpg" width="500" height="105" alt="Success, tweet update" /><br />
Como se ve nuestro mensaje en Twitter, enviado desde Java</a></p>
<p>El protocolo de Twitter soporta muchísimas cosas más. En particular le recomiendo que se lean la documentación relacionada para entender más como trabajan las cosas, en especial la autenticación usando OAth. Ahhh, y por supuesto <a href="http://elangelnegro.cvs.sourceforge.net/viewvc/elangelnegro/src/java/main/com/kodegeek/blog/twitter/">aquí les dejo el código fuente completo</a> para que se diviertan echando código.</p>
<p>Hasta la siguiente entrega, dentro de unas horas me sale ir a una parrillada <img src='http://kodegeek.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Veneblogs: <a href="http://www.veneblogs.com/etiquetas/twitter" rel="tag">twitter</a>, <a href="http://www.veneblogs.com/etiquetas/twitter4j" rel="tag">twitter4j</a>, <a href="http://www.veneblogs.com/etiquetas/swing" rel="tag">swing</a>, <a href="http://www.veneblogs.com/etiquetas/kodegeek" rel="tag">kodegeek</a>, <a href="http://www.veneblogs.com/etiquetas/stupidzombie" rel="tag">stupidzombie</a><br />
<br />Blogalaxia: <a href="http://www.blogalaxia.com/tags/twitter" rel="tag">twitter</a>, <a href="http://www.blogalaxia.com/tags/twitter4j" rel="tag">twitter4j</a>, <a href="http://www.blogalaxia.com/tags/swing" rel="tag">swing</a>, <a href="http://www.blogalaxia.com/tags/kodegeek" rel="tag">kodegeek</a>, <a href="http://www.blogalaxia.com/tags/stupidzombie" rel="tag">stupidzombie</a><br />
<br />To2Blogs: <a href="http://www.to2blogs.com/tag/twitter" rel="tag">twitter</a>, <a href="http://www.to2blogs.com/tag/twitter4j" rel="tag">twitter4j</a>, <a href="http://www.to2blogs.com/tag/swing" rel="tag">swing</a>, <a href="http://www.to2blogs.com/tag/kodegeek" rel="tag">kodegeek</a>, <a href="http://www.to2blogs.com/tag/stupidzombie" rel="tag">stupidzombie</a><br />
<br />Technorati: <a href="http://technorati.com/tag/twitter" rel="tag">twitter</a>, <a href="http://technorati.com/tag/twitter4j" rel="tag">twitter4j</a>, <a href="http://technorati.com/tag/swing" rel="tag">swing</a>, <a href="http://technorati.com/tag/kodegeek" rel="tag">kodegeek</a>, <a href="http://technorati.com/tag/stupidzombie" rel="tag">stupidzombie</a><br />
<br />Del.icio.us: <a href="http://del.icio.us/tag/twitter" rel="tag">twitter</a>, <a href="http://del.icio.us/tag/twitter4j" rel="tag">twitter4j</a>, <a href="http://del.icio.us/tag/swing" rel="tag">swing</a>, <a href="http://del.icio.us/tag/kodegeek" rel="tag">kodegeek</a>, <a href="http://del.icio.us/tag/stupidzombie" rel="tag">stupidzombie</a></p>
]]></content:encoded>
			<wfw:commentRss>http://kodegeek.com/blog/2009/07/05/como-enviar-tweets-desde-java-usando-twitter4j/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Localización en Java (II): El caso de StupidZombie</title>
		<link>http://kodegeek.com/blog/2009/06/21/localizacion-en-java-ii-el-caso-de-stupidzombie/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=localizacion-en-java-ii-el-caso-de-stupidzombie</link>
		<comments>http://kodegeek.com/blog/2009/06/21/localizacion-en-java-ii-el-caso-de-stupidzombie/#comments</comments>
		<pubDate>Mon, 22 Jun 2009 00:28:24 +0000</pubDate>
		<dc:creator>josevnz</dc:creator>
				<category><![CDATA[java]]></category>
		<category><![CDATA[bug]]></category>
		<category><![CDATA[osx]]></category>
		<category><![CDATA[spanglish]]></category>
		<category><![CDATA[stupidzombie]]></category>
		<category><![CDATA[swing]]></category>

		<guid isPermaLink="false">http://kodegeek.com/blog/?p=1907</guid>
		<description><![CDATA[¿Qué tiene de malo la imagen?. Pista: ¡Llámame p&#8217;atras! Bueno, ya casi está listo. Pero cuando digo ya casi es porque aún tengo componentes de Swing los cuales no se portan muy bien en cuanto le cambio el lenguaje y la región al programa. ¿Qué hacer? Parece que es una cucaracha común, en especial con [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.flickr.com/photos/josevnz/3648846296/" title="StupidZombie localization issues by josevnz, on Flickr"><img src="http://farm4.static.flickr.com/3569/3648846296_ab7af2ff5f.jpg" width="500" height="449" alt="StupidZombie localization issues" />¿Qué tiene de malo la imagen?. Pista: ¡Llámame p&#8217;atras!</a></p>
<p>Bueno,<a href="http://kodegeek.com/blog/2009/06/20/soporte-de-java-en-otros-lenguajes-el-caso-de-stupidzombie/"> ya casi</a> está listo. Pero cuando digo ya casi es porque aún tengo componentes de Swing los cuales no se portan muy bien en cuanto le cambio el lenguaje y la región al programa.</p>
<p>¿Qué hacer? Parece que es una cucaracha común, en especial con JFileChooser:</p>
<ul>
<li><a href="http://lists.apple.com/archives/Java-dev/2006/Apr/msg00281.html">http://lists.apple.com/archives/Java-dev/2006/Apr/msg00281.html</a></li>
<li><a href="http://www.rgagnon.com/javadetails/java-0299.html">http://www.rgagnon.com/javadetails/java-0299.html</a></li>
</ul>
<p>Hay soluciones, voy a probarlas y después les digo como me fué. Sin embargo con Swing es irritante ver como la promesa de Java &#8220;Run anywhere&#8221; se quiebra un poquito <img src='http://kodegeek.com/blog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>Veneblogs: <a href="http://www.veneblogs.com/etiquetas/java" rel="tag">java</a>, <a href="http://www.veneblogs.com/etiquetas/swing" rel="tag">swing</a>, <a href="http://www.veneblogs.com/etiquetas/osx" rel="tag">osx</a>, <a href="http://www.veneblogs.com/etiquetas/bug" rel="tag">bug</a>, <a href="http://www.veneblogs.com/etiquetas/spanglish" rel="tag">spanglish</a>, <a href="http://www.veneblogs.com/etiquetas/stupidzombie" rel="tag">stupidzombie</a><br />
<br />Blogalaxia: <a href="http://www.blogalaxia.com/tags/java" rel="tag">java</a>, <a href="http://www.blogalaxia.com/tags/swing" rel="tag">swing</a>, <a href="http://www.blogalaxia.com/tags/osx" rel="tag">osx</a>, <a href="http://www.blogalaxia.com/tags/bug" rel="tag">bug</a>, <a href="http://www.blogalaxia.com/tags/spanglish" rel="tag">spanglish</a>, <a href="http://www.blogalaxia.com/tags/stupidzombie" rel="tag">stupidzombie</a><br />
<br />To2Blogs: <a href="http://www.to2blogs.com/tag/java" rel="tag">java</a>, <a href="http://www.to2blogs.com/tag/swing" rel="tag">swing</a>, <a href="http://www.to2blogs.com/tag/osx" rel="tag">osx</a>, <a href="http://www.to2blogs.com/tag/bug" rel="tag">bug</a>, <a href="http://www.to2blogs.com/tag/spanglish" rel="tag">spanglish</a>, <a href="http://www.to2blogs.com/tag/stupidzombie" rel="tag">stupidzombie</a><br />
<br />Technorati: <a href="http://technorati.com/tag/java" rel="tag">java</a>, <a href="http://technorati.com/tag/swing" rel="tag">swing</a>, <a href="http://technorati.com/tag/osx" rel="tag">osx</a>, <a href="http://technorati.com/tag/bug" rel="tag">bug</a>, <a href="http://technorati.com/tag/spanglish" rel="tag">spanglish</a>, <a href="http://technorati.com/tag/stupidzombie" rel="tag">stupidzombie</a><br />
<br />Del.icio.us: <a href="http://del.icio.us/tag/java" rel="tag">java</a>, <a href="http://del.icio.us/tag/swing" rel="tag">swing</a>, <a href="http://del.icio.us/tag/osx" rel="tag">osx</a>, <a href="http://del.icio.us/tag/bug" rel="tag">bug</a>, <a href="http://del.icio.us/tag/spanglish" rel="tag">spanglish</a>, <a href="http://del.icio.us/tag/stupidzombie" rel="tag">stupidzombie</a></p>
]]></content:encoded>
			<wfw:commentRss>http://kodegeek.com/blog/2009/06/21/localizacion-en-java-ii-el-caso-de-stupidzombie/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Agregando un botón a la celda de una tabla usando Swing</title>
		<link>http://kodegeek.com/blog/2009/04/09/agregando-un-botonatable-usando-swing/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=agregando-un-botonatable-usando-swing</link>
		<comments>http://kodegeek.com/blog/2009/04/09/agregando-un-botonatable-usando-swing/#comments</comments>
		<pubDate>Thu, 09 Apr 2009 10:00:05 +0000</pubDate>
		<dc:creator>josevnz</dc:creator>
				<category><![CDATA[java]]></category>
		<category><![CDATA[kodegeek]]></category>
		<category><![CDATA[programación]]></category>
		<category><![CDATA[jtable]]></category>
		<category><![CDATA[swing]]></category>

		<guid isPermaLink="false">http://kodegeek.com/blog/?p=1747</guid>
		<description><![CDATA[Parece trivial (y una vez que se resuelven todos los pormenores lo es), Sin embargo un problema de &#8220;rendering&#8221; me quebró la cabeza por dos buenos días, hasta que al fin (y con la ayuda de buenos desarrolladores en Internet) le logré dar la vuelta. A la final el código quedó asi: 1 2 3 [...]]]></description>
			<content:encoded><![CDATA[<p><object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/UmDwF2D3avc&#038;color1=0xb1b1b1&#038;color2=0xcfcfcf&#038;hl=en&#038;feature=player_embedded&#038;fs=1"></param><param name="allowFullScreen" value="true"></param><embed src="http://www.youtube.com/v/UmDwF2D3avc&#038;color1=0xb1b1b1&#038;color2=0xcfcfcf&#038;hl=en&#038;feature=player_embedded&#038;fs=1" type="application/x-shockwave-flash" allowfullscreen="true" width="425" height="344"></embed></object></p>
<p>Parece trivial (y una vez que se resuelven todos los pormenores lo es), Sin embargo un problema de &#8220;rendering&#8221; <a href="http://forums.sun.com/thread.jspa?threadID=5378549">me quebró la cabeza por dos buenos días</a>, hasta que al fin (y con la ayuda de buenos desarrolladores en Internet) le logré dar la vuelta.</p>
<p>A la final el código quedó asi:</p>

<div class="wp_codebox"><table><tr id="p174710"><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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
</pre></td><td class="code" id="p1747code10"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">java.util.Date</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">java.util.Random</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">java.util.Vector</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">javax.swing.JButton</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">javax.swing.SwingUtilities</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">javax.swing.table.AbstractTableModel</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">javax.swing.table.TableCellRenderer</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">javax.swing.table.TableColumn</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">javax.swing.JTable</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">javax.swing.table.DefaultTableCellRenderer</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">javax.swing.AbstractCellEditor</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">javax.swing.JFrame</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">javax.swing.JOptionPane</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">javax.swing.JScrollPane</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">javax.swing.UIManager</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">javax.swing.table.TableCellEditor</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">java.awt.BorderLayout</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">java.awt.Component</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">java.awt.Dimension</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">java.text.SimpleDateFormat</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">java.awt.event.ActionEvent</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">java.awt.event.ActionListener</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> GuiWithProblems <span style="color: #000000; font-weight: bold;">extends</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Ajframe+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">JFrame</span></a> <span style="color: #009900;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #000000; font-weight: bold;">final</span> <span style="color: #000066; font-weight: bold;">long</span> serialVersionUID <span style="color: #339933;">=</span> 1L<span style="color: #339933;">;</span>
	<span style="color: #000000; font-weight: bold;">private</span> DataTableModel model<span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">enum</span> TableHeader <span style="color: #009900;">&#123;</span>
		<a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Adate+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">Date</span></a><span style="color: #009900;">&#40;</span><a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Adate+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">Date</span></a>.<span style="color: #000000; font-weight: bold;">class</span><span style="color: #009900;">&#41;</span>, Counter<span style="color: #009900;">&#40;</span><a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Ainteger+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">Integer</span></a>.<span style="color: #000000; font-weight: bold;">class</span><span style="color: #009900;">&#41;</span>, <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Aname+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">Name</span></a><span style="color: #009900;">&#40;</span><a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">String</span></a>.<span style="color: #000000; font-weight: bold;">class</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		Class<span style="color: #339933;">&lt;</span> <span style="color: #339933;">?&gt;</span> currClass<span style="color: #339933;">;</span>
		<span style="color: #000000; font-weight: bold;">private</span> TableHeader<span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">Class</span> <span style="color: #339933;">&lt;</span> <span style="color: #339933;">?&gt;</span>currClass<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">currClass</span> <span style="color: #339933;">=</span> currClass<span style="color: #339933;">;</span><span style="color: #009900;">&#125;</span>
		<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">Class</span> <span style="color: #339933;">&lt;</span> <span style="color: #339933;">?&gt;</span>getCurrClass<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;">return</span> currClass<span style="color: #339933;">;</span><span style="color: #009900;">&#125;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	@SuppressWarnings<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;unchecked&quot;</span><span style="color: #009900;">&#41;</span>
	<span style="color: #000000; font-weight: bold;">public</span> GuiWithProblems<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: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Simple GUI with JTable&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		setPreferredSize<span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Adimension+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">Dimension</span></a><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">600</span>, <span style="color: #cc66cc;">500</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		setLayout<span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Aborderlayout+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">BorderLayout</span></a><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		setDefaultCloseOperation<span style="color: #009900;">&#40;</span>EXIT_ON_CLOSE<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		@SuppressWarnings<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;unused&quot;</span><span style="color: #009900;">&#41;</span>
		Vector<span style="color: #339933;">&lt;</span> <span style="color: #339933;">?&gt;</span> data <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Avector+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">Vector</span></a><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		model <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> DataTableModel<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>		
		<a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Ajtable+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">JTable</span></a> table <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Ajtable+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">JTable</span></a><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		table.<span style="color: #006633;">setModel</span><span style="color: #009900;">&#40;</span>model<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		table.<span style="color: #006633;">setColumnSelectionAllowed</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		table.<span style="color: #006633;">setRowSelectionAllowed</span><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>
		<a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Atablecellrenderer+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">TableCellRenderer</span></a> render <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> GuiCellRenderer<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Atablecolumn+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">TableColumn</span></a> col <span style="color: #339933;">=</span> table.<span style="color: #006633;">getColumnModel</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">getColumn</span><span style="color: #009900;">&#40;</span>TableHeader.<a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Aname+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">Name</span></a>.<span style="color: #006633;">ordinal</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Ajbutton+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">JButton</span></a> editorBtn <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Ajbutton+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">JButton</span></a><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		col.<span style="color: #006633;">setCellEditor</span><span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> GuiCellEditor<span style="color: #009900;">&#40;</span>table<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		col.<span style="color: #006633;">setCellRenderer</span><span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> NameBtnCellRenderer<span style="color: #009900;">&#40;</span>editorBtn<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		table.<span style="color: #006633;">setDefaultRenderer</span><span style="color: #009900;">&#40;</span><a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Adate+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">Date</span></a>.<span style="color: #000000; font-weight: bold;">class</span>, render<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		table.<span style="color: #006633;">setDefaultRenderer</span><span style="color: #009900;">&#40;</span><a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Adouble+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">Double</span></a>.<span style="color: #000000; font-weight: bold;">class</span>, render<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		table.<span style="color: #006633;">setDefaultRenderer</span><span style="color: #009900;">&#40;</span><a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Along+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">Long</span></a>.<span style="color: #000000; font-weight: bold;">class</span>, render<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		table.<span style="color: #006633;">setDefaultRenderer</span><span style="color: #009900;">&#40;</span><a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Ainteger+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">Integer</span></a>.<span style="color: #000000; font-weight: bold;">class</span>, render<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		table.<span style="color: #006633;">setDefaultRenderer</span><span style="color: #009900;">&#40;</span><a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">String</span></a>.<span style="color: #000000; font-weight: bold;">class</span>, render<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		getContentPane<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">add</span><span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Ajscrollpane+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">JScrollPane</span></a><span style="color: #009900;">&#40;</span>table<span style="color: #009900;">&#41;</span>, <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Aborderlayout+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">BorderLayout</span></a>.<span style="color: #006633;">CENTER</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	@SuppressWarnings<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;unchecked&quot;</span><span style="color: #009900;">&#41;</span>
	<span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000066; font-weight: bold;">void</span> addData<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Arandom+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">Random</span></a> random <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Arandom+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">Random</span></a><span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Adate+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">Date</span></a><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">getTime</span><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: #000000; font-weight: bold;">for</span> <span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">int</span> i <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span> i <span style="color: #339933;">&lt;</span> <span style="color: #cc66cc;">20</span><span style="color: #339933;">;</span> i<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			<a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Avector+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">Vector</span></a> data <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Avector+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">Vector</span></a><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			data.<span style="color: #006633;">add</span><span style="color: #009900;">&#40;</span>TableHeader.<a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Adate+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">Date</span></a>.<span style="color: #006633;">ordinal</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>, <span style="color: #000000; font-weight: bold;">new</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Adate+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">Date</span></a><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			data.<span style="color: #006633;">add</span><span style="color: #009900;">&#40;</span>TableHeader.<span style="color: #006633;">Counter</span>.<span style="color: #006633;">ordinal</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>, i<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			data.<span style="color: #006633;">add</span><span style="color: #009900;">&#40;</span>TableHeader.<a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Aname+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">Name</span></a>.<span style="color: #006633;">ordinal</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>, random.<span style="color: #006633;">nextInt</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">+</span> <span style="color: #0000ff;">&quot;&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			model.<span style="color: #006633;">add</span><span style="color: #009900;">&#40;</span>data<span style="color: #009900;">&#41;</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;">final</span> <span style="color: #000066; font-weight: bold;">void</span> showGui<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Aswingutilities+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">SwingUtilities</span></a>.<span style="color: #006633;">invokeLater</span><span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Arunnable+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">Runnable</span></a><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>	pack<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>	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><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>
&nbsp;
	<span style="color: #008000; font-style: italic; font-weight: bold;">/**
	 * @param args
	 */</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> main<span style="color: #009900;">&#40;</span><a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">String</span></a><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>
		<span style="color: #000000; font-weight: bold;">final</span> GuiWithProblems instance <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> GuiWithProblems<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Aswingutilities+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">SwingUtilities</span></a>.<span style="color: #006633;">invokeLater</span><span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Arunnable+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">Runnable</span></a><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			@Override
			<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>
				instance.<span style="color: #006633;">showGui</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
				instance.<span style="color: #006633;">addData</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: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> DataTableModel <span style="color: #000000; font-weight: bold;">extends</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Aabstracttablemodel+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">AbstractTableModel</span></a> <span style="color: #009900;">&#123;</span>
		<span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #000000; font-weight: bold;">final</span> <span style="color: #000066; font-weight: bold;">long</span> serialVersionUID <span style="color: #339933;">=</span> 769042563295665904L<span style="color: #339933;">;</span>
		@SuppressWarnings<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;unchecked&quot;</span><span style="color: #009900;">&#41;</span>
		<span style="color: #000000; font-weight: bold;">private</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Avector+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">Vector</span></a> data<span style="color: #339933;">;</span>
&nbsp;
		@SuppressWarnings<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;unchecked&quot;</span><span style="color: #009900;">&#41;</span>
		<span style="color: #000000; font-weight: bold;">public</span> DataTableModel<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			data <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Avector+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">Vector</span></a><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
&nbsp;
		@Override
		<span style="color: #000000; font-weight: bold;">public</span> Class<span style="color: #339933;">&lt;?&gt;</span> getColumnClass<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">int</span> columnIndex<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><span style="color: #000000; font-weight: bold;">return</span> TableHeader.<span style="color: #006633;">values</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#91;</span>columnIndex<span style="color: #009900;">&#93;</span>.<span style="color: #006633;">getCurrClass</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><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;">int</span> getRowCount<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;">return</span> data.<span style="color: #006633;">size</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><span style="color: #009900;">&#125;</span>
&nbsp;
		@SuppressWarnings<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;unchecked&quot;</span><span style="color: #009900;">&#41;</span>
		@Override
		<span style="color: #000000; font-weight: bold;">public</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Aobject+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">Object</span></a> getValueAt<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">int</span> rowIndex, <span style="color: #000066; font-weight: bold;">int</span> columnIndex<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			<a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Avector+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">Vector</span></a> elem <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span><a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Avector+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">Vector</span></a><span style="color: #009900;">&#41;</span> data.<span style="color: #006633;">get</span><span style="color: #009900;">&#40;</span>rowIndex<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #000000; font-weight: bold;">switch</span> <span style="color: #009900;">&#40;</span>TableHeader.<span style="color: #006633;">values</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#91;</span>columnIndex<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #000000; font-weight: bold;">case</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Adate+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">Date</span></a><span style="color: #339933;">:</span> 
				<span style="color: #000000; font-weight: bold;">return</span> elem.<span style="color: #006633;">get</span><span style="color: #009900;">&#40;</span>TableHeader.<a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Adate+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">Date</span></a>.<span style="color: #006633;">ordinal</span><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: #000000; font-weight: bold;">case</span> Counter<span style="color: #339933;">:</span> 
				<span style="color: #000000; font-weight: bold;">return</span> elem.<span style="color: #006633;">get</span><span style="color: #009900;">&#40;</span>TableHeader.<span style="color: #006633;">Counter</span>.<span style="color: #006633;">ordinal</span><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: #000000; font-weight: bold;">case</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Aname+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">Name</span></a><span style="color: #339933;">:</span>
				<span style="color: #000000; font-weight: bold;">return</span> elem.<span style="color: #006633;">get</span><span style="color: #009900;">&#40;</span>TableHeader.<a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Aname+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">Name</span></a>.<span style="color: #006633;">ordinal</span><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: #000000; font-weight: bold;">default</span><span style="color: #339933;">:</span> 
				<span style="color: #000000; font-weight: bold;">return</span> <span style="color: #000066; font-weight: bold;">null</span><span style="color: #339933;">;</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;">int</span> getColumnCount<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;">return</span> TableHeader.<span style="color: #006633;">values</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">length</span><span style="color: #339933;">;</span><span style="color: #009900;">&#125;</span>
&nbsp;
		@Override
		<span style="color: #000000; font-weight: bold;">public</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">String</span></a> getColumnName<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">int</span> column<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><span style="color: #000000; font-weight: bold;">return</span> TableHeader.<span style="color: #006633;">values</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#91;</span>column<span style="color: #009900;">&#93;</span>.<span style="color: #006633;">name</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><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;">boolean</span> isCellEditable<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">int</span> row, <span style="color: #000066; font-weight: bold;">int</span> column<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>column <span style="color: #339933;">==</span> TableHeader.<a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Aname+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">Name</span></a>.<span style="color: #006633;">ordinal</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">return</span> <span style="color: #000066; font-weight: bold;">true</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// ENABLE THE EDITOR JUST FOR THE NAME</span>
			<span style="color: #000000; font-weight: bold;">return</span> <span style="color: #000066; font-weight: bold;">false</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
&nbsp;
		<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> add<span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">final</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Aobject+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">Object</span></a> elem<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			<a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Aswingutilities+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">SwingUtilities</span></a>.<span style="color: #006633;">invokeLater</span><span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Arunnable+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">Runnable</span></a><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
				@SuppressWarnings<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;unchecked&quot;</span><span style="color: #009900;">&#41;</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>
					data.<span style="color: #006633;">add</span><span style="color: #009900;">&#40;</span>elem<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
					<span style="color: #000066; font-weight: bold;">int</span> rows <span style="color: #339933;">=</span> getRowCount<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">-</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span>
					fireTableRowsInserted<span style="color: #009900;">&#40;</span>rows, rows<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;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
	<span style="color: #009900;">&#125;</span>
	<span style="color: #666666; font-style: italic;">// General editor</span>
	<span style="color: #000000; font-weight: bold;">class</span> GuiCellRenderer <span style="color: #000000; font-weight: bold;">extends</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Adefaulttablecellrenderer+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">DefaultTableCellRenderer</span></a>  <span style="color: #009900;">&#123;</span>
		<span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #000000; font-weight: bold;">final</span> <span style="color: #000066; font-weight: bold;">long</span> serialVersionUID <span style="color: #339933;">=</span> 211718743340765799L<span style="color: #339933;">;</span>
		<span style="color: #000000; font-weight: bold;">private</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Asimpledateformat+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">SimpleDateFormat</span></a> dForm<span style="color: #339933;">;</span>
		<span style="color: #000000; font-weight: bold;">public</span> GuiCellRenderer<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: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			dForm <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Asimpledateformat+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">SimpleDateFormat</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;hh:mm:ss a&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
&nbsp;
		@Override
		<span style="color: #000000; font-weight: bold;">public</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Acomponent+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">Component</span></a> getTableCellRendererComponent<span style="color: #009900;">&#40;</span><a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Ajtable+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">JTable</span></a> table, <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Aobject+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">Object</span></a> val, <span style="color: #000066; font-weight: bold;">boolean</span> select, <span style="color: #000066; font-weight: bold;">boolean</span> focus, <span style="color: #000066; font-weight: bold;">int</span> row, <span style="color: #000066; font-weight: bold;">int</span> col<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;">getTableCellRendererComponent</span><span style="color: #009900;">&#40;</span>table, val, select, focus, row, col<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// Make sure gets called</span>
			<span style="color: #000000; font-weight: bold;">switch</span> <span style="color: #009900;">&#40;</span>TableHeader.<span style="color: #006633;">values</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#91;</span>table.<span style="color: #006633;">convertColumnIndexToModel</span><span style="color: #009900;">&#40;</span>col<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #000000; font-weight: bold;">case</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Adate+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">Date</span></a><span style="color: #339933;">:</span>
				setText<span style="color: #009900;">&#40;</span>dForm.<span style="color: #006633;">format</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span><a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Adate+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">Date</span></a><span style="color: #009900;">&#41;</span>val<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
				<span style="color: #000000; font-weight: bold;">break</span><span style="color: #339933;">;</span>
			<span style="color: #000000; font-weight: bold;">case</span> Counter<span style="color: #339933;">:</span>
				<a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Ainteger+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">Integer</span></a> iVal <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span><a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Ainteger+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">Integer</span></a><span style="color: #009900;">&#41;</span> val<span style="color: #339933;">;</span>
				setText<span style="color: #009900;">&#40;</span>iVal.<span style="color: #006633;">toString</span><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: #000000; font-weight: bold;">break</span><span style="color: #339933;">;</span>
			<span style="color: #000000; font-weight: bold;">case</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Aname+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">Name</span></a><span style="color: #339933;">:</span>
				setText<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span><a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">String</span></a><span style="color: #009900;">&#41;</span> val<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
				<span style="color: #000000; font-weight: bold;">break</span><span style="color: #339933;">;</span>
			<span style="color: #000000; font-weight: bold;">default</span><span style="color: #339933;">:</span>
				setText<span style="color: #009900;">&#40;</span>val.<span style="color: #006633;">toString</span><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: #000000; font-weight: bold;">break</span><span style="color: #339933;">;</span>
			<span style="color: #009900;">&#125;</span>
			<span style="color: #000000; font-weight: bold;">return</span> <span style="color: #000000; font-weight: bold;">this</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
	<span style="color: #009900;">&#125;</span>
	<span style="color: #666666; font-style: italic;">// Renderer used only for the name, renders column as button</span>
	<span style="color: #000000; font-weight: bold;">class</span> NameBtnCellRenderer <span style="color: #000000; font-weight: bold;">extends</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Adefaulttablecellrenderer+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">DefaultTableCellRenderer</span></a>  <span style="color: #009900;">&#123;</span>
		<span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #000000; font-weight: bold;">final</span> <span style="color: #000066; font-weight: bold;">long</span> serialVersionUID <span style="color: #339933;">=</span> 2L<span style="color: #339933;">;</span>
		<span style="color: #000000; font-weight: bold;">private</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Ajbutton+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">JButton</span></a> btn<span style="color: #339933;">;</span>
		<span style="color: #000000; font-weight: bold;">public</span> NameBtnCellRenderer<span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">final</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Ajbutton+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">JButton</span></a> aBtn<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #000000; font-weight: bold;">super</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			btn <span style="color: #339933;">=</span> aBtn<span style="color: #339933;">;</span>
			btn.<span style="color: #006633;">setFocusPainted</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
&nbsp;
		@Override
		<span style="color: #000000; font-weight: bold;">public</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Acomponent+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">Component</span></a> getTableCellRendererComponent<span style="color: #009900;">&#40;</span><a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Ajtable+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">JTable</span></a> table, <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Aobject+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">Object</span></a> val, <span style="color: #000066; font-weight: bold;">boolean</span> select, <span style="color: #000066; font-weight: bold;">boolean</span> focus, <span style="color: #000066; font-weight: bold;">int</span> row, <span style="color: #000066; font-weight: bold;">int</span> col<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;">getTableCellRendererComponent</span><span style="color: #009900;">&#40;</span>table, val, select, focus, row, col<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>focus<span style="color: #009900;">&#41;</span>  <span style="color: #009900;">&#123;</span>
            	btn.<span style="color: #006633;">setForeground</span><span style="color: #009900;">&#40;</span>table.<span style="color: #006633;">getForeground</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            	btn.<span style="color: #006633;">setBackground</span><span style="color: #009900;">&#40;</span><a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Auimanager+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">UIManager</span></a>.<span style="color: #006633;">getColor</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Button.background&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #009900;">&#125;</span>
            <span style="color: #000000; font-weight: bold;">else</span> <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>select<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            	btn.<span style="color: #006633;">setForeground</span><span style="color: #009900;">&#40;</span>table.<span style="color: #006633;">getSelectionForeground</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            	btn.<span style="color: #006633;">setBackground</span><span style="color: #009900;">&#40;</span>table.<span style="color: #006633;">getSelectionBackground</span><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: #000000; font-weight: bold;">else</span> <span style="color: #009900;">&#123;</span>
            	btn.<span style="color: #006633;">setForeground</span><span style="color: #009900;">&#40;</span>table.<span style="color: #006633;">getForeground</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            	btn.<span style="color: #006633;">setBackground</span><span style="color: #009900;">&#40;</span><a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Auimanager+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">UIManager</span></a>.<span style="color: #006633;">getColor</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Button.background&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #009900;">&#125;</span>
&nbsp;
            btn.<span style="color: #006633;">setText</span><span style="color: #009900;">&#40;</span> <span style="color: #009900;">&#40;</span>val <span style="color: #339933;">==</span> <span style="color: #000066; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">?</span> <span style="color: #0000ff;">&quot;&quot;</span> <span style="color: #339933;">:</span> val.<span style="color: #006633;">toString</span><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: #000000; font-weight: bold;">return</span> btn<span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
	<span style="color: #009900;">&#125;</span>
	<span style="color: #666666; font-style: italic;">// Cell editor for the name (button)</span>
	<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> GuiCellEditor <span style="color: #000000; font-weight: bold;">extends</span>  <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Aabstractcelleditor+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">AbstractCellEditor</span></a> <span style="color: #000000; font-weight: bold;">implements</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Atablecelleditor+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">TableCellEditor</span></a>, <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Aactionlistener+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">ActionListener</span></a> <span style="color: #009900;">&#123;</span>
		<span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #000000; font-weight: bold;">final</span> <span style="color: #000066; font-weight: bold;">long</span> serialVersionUID <span style="color: #339933;">=</span> 9L<span style="color: #339933;">;</span>
		<span style="color: #000000; font-weight: bold;">private</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Ajbutton+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">JButton</span></a> btn<span style="color: #339933;">;</span>
		<span style="color: #000000; font-weight: bold;">private</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Acomponent+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">Component</span></a> comp<span style="color: #339933;">;</span>
		<span style="color: #000000; font-weight: bold;">public</span> GuiCellEditor<span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">final</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Acomponent+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">Component</span></a> aComp<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			btn <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Ajbutton+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">JButton</span></a><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			btn.<span style="color: #006633;">addActionListener</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>
			comp <span style="color: #339933;">=</span> aComp<span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
&nbsp;
		@Override
		<span style="color: #000000; font-weight: bold;">public</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Acomponent+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">Component</span></a> getTableCellEditorComponent<span style="color: #009900;">&#40;</span><a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Ajtable+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">JTable</span></a> table, <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Aobject+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">Object</span></a> value, <span style="color: #000066; font-weight: bold;">boolean</span> isSelected, <span style="color: #000066; font-weight: bold;">int</span> row, <span style="color: #000066; font-weight: bold;">int</span> column<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			<a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">String</span></a> val <span style="color: #339933;">=</span> table.<span style="color: #006633;">getValueAt</span><span style="color: #009900;">&#40;</span>row, column<span style="color: #009900;">&#41;</span> <span style="color: #339933;">==</span> <span style="color: #000066; font-weight: bold;">null</span><span style="color: #339933;">?</span> <span style="color: #0000ff;">&quot;&quot;</span><span style="color: #339933;">:</span> table.<span style="color: #006633;">getValueAt</span><span style="color: #009900;">&#40;</span>row, column<span style="color: #009900;">&#41;</span>.<span style="color: #006633;">toString</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			btn.<span style="color: #006633;">setText</span><span style="color: #009900;">&#40;</span>val<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #000000; font-weight: bold;">return</span> btn<span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
&nbsp;
		@Override
		<span style="color: #000000; font-weight: bold;">public</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Aobject+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">Object</span></a> getCellEditorValue<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;">return</span> btn.<span style="color: #006633;">getText</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><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> actionPerformed<span style="color: #009900;">&#40;</span><a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Aactionevent+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">ActionEvent</span></a> e<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			<a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Aswingutilities+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">SwingUtilities</span></a>.<span style="color: #006633;">invokeLater</span><span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Arunnable+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">Runnable</span></a><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
				@Override
				<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>
					<a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Aswingutilities+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">SwingUtilities</span></a>.<span style="color: #006633;">invokeLater</span><span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Arunnable+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">Runnable</span></a><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
						@Override
						<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>
							fireEditingStopped<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
							<a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Ajoptionpane+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">JOptionPane</span></a>.<span style="color: #006633;">showMessageDialog</span><span style="color: #009900;">&#40;</span>comp, <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">String</span></a>.<span style="color: #006633;">format</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Not much to show, %s&quot;</span>, btn.<span style="color: #006633;">getText</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>, <span style="color: #0000ff;">&quot;About&quot;</span>, <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Ajoptionpane+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">JOptionPane</span></a>.<span style="color: #006633;">INFORMATION_MESSAGE</span>, <span style="color: #000066; font-weight: bold;">null</span><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;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
				<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>
	<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>Les dejó el código para que lo disfruten, aún tiene un bug en OSX (Linux y Windows no tienen el problema). Espero sus comentarios como siempre <img src='http://kodegeek.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Veneblogs: <a href="http://www.veneblogs.com/etiquetas/swing" rel="tag">swing</a>, <a href="http://www.veneblogs.com/etiquetas/java" rel="tag">java</a>, <a href="http://www.veneblogs.com/etiquetas/kodegeek" rel="tag">kodegeek</a>, <a href="http://www.veneblogs.com/etiquetas/jtable" rel="tag">jtable</a><br />
<br />Blogalaxia: <a href="http://www.blogalaxia.com/tags/swing" rel="tag">swing</a>, <a href="http://www.blogalaxia.com/tags/java" rel="tag">java</a>, <a href="http://www.blogalaxia.com/tags/kodegeek" rel="tag">kodegeek</a>, <a href="http://www.blogalaxia.com/tags/jtable" rel="tag">jtable</a><br />
<br />To2blogs: <a href="http://www.to2blogs.com/tag/swing" rel="tag">swing</a>, <a href="http://www.to2blogs.com/tag/java" rel="tag">java</a>, <a href="http://www.to2blogs.com/tag/kodegeek" rel="tag">kodegeek</a>, <a href="http://www.to2blogs.com/tag/jtable" rel="tag">jtable</a><br />
<br />Technorati: <a href="http://technorati.com/tag/swing" rel="tag">swing</a>, <a href="http://technorati.com/tag/java" rel="tag">java</a>, <a href="http://technorati.com/tag/kodegeek" rel="tag">kodegeek</a>, <a href="http://technorati.com/tag/jtable" rel="tag">jtable</a><br />
<br />Del.icio.us: <a href="http://del.icio.us/tag/swing" rel="tag">swing</a>, <a href="http://del.icio.us/tag/java" rel="tag">java</a>, <a href="http://del.icio.us/tag/kodegeek" rel="tag">kodegeek</a>, <a href="http://del.icio.us/tag/jtable" rel="tag">jtable</a></p>
]]></content:encoded>
			<wfw:commentRss>http://kodegeek.com/blog/2009/04/09/agregando-un-botonatable-usando-swing/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Java y Swing: Cuando el rehuso no es lo mejor</title>
		<link>http://kodegeek.com/blog/2008/08/17/java-y-swing-cuando-el-rehuso-no-es-lo-mejor/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=java-y-swing-cuando-el-rehuso-no-es-lo-mejor</link>
		<comments>http://kodegeek.com/blog/2008/08/17/java-y-swing-cuando-el-rehuso-no-es-lo-mejor/#comments</comments>
		<pubDate>Mon, 18 Aug 2008 00:51:00 +0000</pubDate>
		<dc:creator>josevnz</dc:creator>
				<category><![CDATA[java]]></category>
		<category><![CDATA[desktop]]></category>
		<category><![CDATA[preferences]]></category>
		<category><![CDATA[rehuso]]></category>
		<category><![CDATA[swing]]></category>
		<category><![CDATA[synth]]></category>

		<guid isPermaLink="false">http://kodegeek.com/blog/?p=1275</guid>
		<description><![CDATA[Ha pasado un rato bien largo desde que escribo en el blog; La razón principal es que he estado estudiando (en algún momento les comentaré para qué) y decidí concentrarme únicamente en eso y en el trabajo. Cero distracciones. Lo otro es que ahora estoy haciendo algo que no habia hecho antes: Aplicaciones de escritorio [...]]]></description>
			<content:encoded><![CDATA[<p>Ha pasado un rato bien largo desde que escribo en el blog; La razón principal es que he estado estudiando (en algún momento les comentaré para qué) y decidí concentrarme únicamente en eso y en el trabajo.</p>
<p>Cero distracciones.</p>
<p>Lo otro es que ahora estoy haciendo algo que no habia hecho antes: Aplicaciones de escritorio en Java. Si bien el lenguaje es el mismo, las implicaciones son diferentes de cuando se hace una aplicación del lado del servidor o aplicaciones web.</p>
<p>Los operadores de piso (traders) con quien trabajo empezaron nuevos negocios y varios de ellos pedian aplicaciones en Swing. Incialmente comenzé con una muy sencilla, escrita totalmente desde cero la cual recibe ordenes que los corredores de bolsa hacen las cuales deben ser aprobadas por los operadores (me disculpan si los términos no son exactos pero es que me da una flojera enorme de hacer spanglish <img src='http://kodegeek.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> ). De allí alguien se dió cuenta que podía ayudarlos a acomodar la aplicación de trading principal.</p>
<p>En este caso, el componente que tenia problemas trabajaba bien &#8230; hasta la 1:00 de la tarde. Después de allí fallaba por falta de memoria y los analistas no odian ver sus transacciones en tiempo real de ahi en adelante.</p>
<p>La aplicación original es impresionante, con un montón de aditamento que la hacen sofisticada aún el día de hoy, 5 años después que fué creada (la aplicación ha tenido varias reencarnaciones, cada una de ellas con más funcionalidad). El problema es que tiene capas, capas y más capas de código hecho en casa el cual ya no es compatible con Java 1.6 (de hecho, aún tenemos que correr la mayor parte de esta en una versión anterior de la máquina virtual).</p>
<p>¿Cual fué la solución? Me pidieron que volviera a escribir esa parte de la aplicación (sin otros detalles) en una tarde. La única forma que se me ocurrió fué escribirla a mi manera usando solamente Swing, ningún aditamento.</p>
<p>La aplicación comenzó como un prototipo, del cual todos estabamos algo temerosos (400 mil entradas al día y desempeño rápido eran los requerimientos).  De allí cosas básicas como <a href="http://forums.java.net/jive/message.jspa?messageID=291138#291138">ordenar y ocultar columnas, filtros</a>, <a href="http://elangelnegro.cvs.sourceforge.net/elangelnegro/src/java/main/com/kodegeek/blog/pervasive/perk/TableHelper.java?revision=1.2&amp;view=markup">exportar los  datos a Excel</a> (<span style="font-style: italic;">Si, si la aplicación tiene tablas</span>) entre otros se portaron muy bien. Hubo que tener en cuenta problemas de concurrencia (ya que la aplicación es de alto número de transacciones, además de que debe mostrar todas las operaciones del dia, haciendo una repetición de todas  las que hayan ocurrido antes de arrancar el programa).</p>
<p><span style="font-style: italic;">E</span><span style="font-style: italic;">l nuevo componente no sólo muestra 500 mil transacciones sin problema, sino que además es más rápido (ya lo usamos en días de alto volumen y con expiración de opciones. Trabajó sin chistar)</span>. Agregarle la funcionalidad de la aplicación vieja no fué tan difícil y resulta que ahora los operadores con los que trabajo se mudaron a la nueva aplicación.</p>
<p>Y aún sigo aprendiendo cosas nuevas de Swing. Lo último que descubrí es que soporta pieles, usando <a href="http://weblogs.java.net/blog/gfx/archive/2005/09/synth_week_load.html">Synth</a> y que la integración nativa con el escritorio ha mejorado mucho.</p>
<p>Supongo que esta es una de esas ocasiones en donde es mejor &#8220;quemar al rancho&#8221; y volver a construir desde cero.</p>
<p>Ya les comentare más, pero si quieren leer sobre mis andanzas estos días <a href="http://forums.java.net/jive/forum.jspa?forumID=74&amp;start=0">metanse en los foros de Java Swing de Sun</a> <img src='http://kodegeek.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> .</p>
<p>Buscar en otros sitios:</p>
<p>Blogalaxia:<a href="http://www.blogalaxia.com/tags/java" rel="tag">java</a>, <a href="http://www.blogalaxia.com/tags/rehuso" rel="tag">rehuso</a>, <a href="http://www.blogalaxia.com/tags/swing" rel="tag">swing</a>, <a href="http://www.blogalaxia.com/tags/synth" rel="tag">synth</a>, <a href="http://www.blogalaxia.com/tags/preferences" rel="tag">preferences</a>, <a href="http://www.blogalaxia.com/tags/desktop" rel="tag">desktop</a><br />Technorati:<a href="http://technorati.com/tag/java" rel="tag">java</a>, <a href="http://technorati.com/tag/rehuso" rel="tag">rehuso</a>, <a href="http://technorati.com/tag/swing" rel="tag">swing</a>, <a href="http://technorati.com/tag/synth" rel="tag">synth</a>, <a href="http://technorati.com/tag/preferences" rel="tag">preferences</a>, <a href="http://technorati.com/tag/desktop" rel="tag">desktop</a><br />To2blogs:<a href="http://www.to2blogs.com/tag/java" rel="tag">java</a>, <a href="http://www.to2blogs.com/tag/rehuso" rel="tag">rehuso</a>, <a href="http://www.to2blogs.com/tag/swing" rel="tag">swing</a>, <a href="http://www.to2blogs.com/tag/synth" rel="tag">synth</a>, <a href="http://www.to2blogs.com/tag/preferences" rel="tag">preferences</a>, <a href="http://www.to2blogs.com/tag/desktop" rel="tag">desktop</a><br />Del.icio.us:<a href="http://del.icio.us/tag/java" rel="tag">java</a>, <a href="http://del.icio.us/tag/rehuso" rel="tag">rehuso</a>, <a href="http://del.icio.us/tag/swing" rel="tag">swing</a>, <a href="http://del.icio.us/tag/synth" rel="tag">synth</a>, <a href="http://del.icio.us/tag/preferences" rel="tag">preferences</a>, <a href="http://del.icio.us/tag/desktop" rel="tag">desktop</a></p>
]]></content:encoded>
			<wfw:commentRss>http://kodegeek.com/blog/2008/08/17/java-y-swing-cuando-el-rehuso-no-es-lo-mejor/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>RowSorter, &quot;AWT-EventQueue-0&quot; java.lang.ArrayIndexOutOfBoundsException</title>
		<link>http://kodegeek.com/blog/2008/08/02/rowsorter-awt-eventqueue-0-javalangarrayindexoutofboundsexception/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=rowsorter-awt-eventqueue-0-javalangarrayindexoutofboundsexception</link>
		<comments>http://kodegeek.com/blog/2008/08/02/rowsorter-awt-eventqueue-0-javalangarrayindexoutofboundsexception/#comments</comments>
		<pubDate>Sat, 02 Aug 2008 18:12:00 +0000</pubDate>
		<dc:creator>josevnz</dc:creator>
				<category><![CDATA[java.lang.ArrayIndexOutOfBoundsException]]></category>
		<category><![CDATA[jtable]]></category>
		<category><![CDATA[swing]]></category>

		<guid isPermaLink="false">http://kodegeek.com/blog/?p=1274</guid>
		<description><![CDATA[Les tengo una pregunta a todos los gurus de Java: ¿Cual es el problema con JTable y el uso de RowSorter? Más detalles aquí, gracias de antemano a quien tenga la respuesta (yo corpartire mi descubrimientos). Buscar en otros sitios: Blogalaxia:java.lang.ArrayIndexOutOfBoundsException, swing, jtableTechnorati:java.lang.ArrayIndexOutOfBoundsException, swing, jtableTo2blogs:java.lang.ArrayIndexOutOfBoundsException, swing, jtableDel.icio.us:java.lang.ArrayIndexOutOfBoundsException, swing, jtable]]></description>
			<content:encoded><![CDATA[<p>Les tengo una pregunta a todos los gurus de Java: ¿Cual es el problema con JTable y el uso de RowSorter?</p>
<p><a href="http://forums.java.net/jive/thread.jspa?threadID=44999&amp;tstart=0">Más detalles aquí</a>, gracias de antemano a quien tenga la respuesta (yo corpartire mi descubrimientos).</p>
<p>Buscar en otros sitios:</p>
<p>Blogalaxia:<a href="http://www.blogalaxia.com/tags/java.lang.ArrayIndexOutOfBoundsException" rel="tag">java.lang.ArrayIndexOutOfBoundsException</a>, <a href="http://www.blogalaxia.com/tags/swing" rel="tag">swing</a>, <a href="http://www.blogalaxia.com/tags/jtable" rel="tag">jtable</a><br />Technorati:<a href="http://technorati.com/tag/java.lang.ArrayIndexOutOfBoundsException" rel="tag">java.lang.ArrayIndexOutOfBoundsException</a>, <a href="http://technorati.com/tag/swing" rel="tag">swing</a>, <a href="http://technorati.com/tag/jtable" rel="tag">jtable</a><br />To2blogs:<a href="http://www.to2blogs.com/tag/java.lang.ArrayIndexOutOfBoundsException" rel="tag">java.lang.ArrayIndexOutOfBoundsException</a>, <a href="http://www.to2blogs.com/tag/swing" rel="tag">swing</a>, <a href="http://www.to2blogs.com/tag/jtable" rel="tag">jtable</a><br />Del.icio.us:<a href="http://del.icio.us/tag/java.lang.ArrayIndexOutOfBoundsException" rel="tag">java.lang.ArrayIndexOutOfBoundsException</a>, <a href="http://del.icio.us/tag/swing" rel="tag">swing</a>, <a href="http://del.icio.us/tag/jtable" rel="tag">jtable</a></p>
]]></content:encoded>
			<wfw:commentRss>http://kodegeek.com/blog/2008/08/02/rowsorter-awt-eventqueue-0-javalangarrayindexoutofboundsexception/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Generando gráficos de temperatura en Swing</title>
		<link>http://kodegeek.com/blog/2008/06/28/generando-graficos-de-temperatura-en-swing/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=generando-graficos-de-temperatura-en-swing</link>
		<comments>http://kodegeek.com/blog/2008/06/28/generando-graficos-de-temperatura-en-swing/#comments</comments>
		<pubDate>Sun, 29 Jun 2008 03:40:00 +0000</pubDate>
		<dc:creator>josevnz</dc:creator>
				<category><![CDATA[kodegeek]]></category>
		<category><![CDATA[jfreechart]]></category>
		<category><![CDATA[perk]]></category>
		<category><![CDATA[sentilla]]></category>
		<category><![CDATA[swing]]></category>

		<guid isPermaLink="false">http://kodegeek.com/blog/?p=1268</guid>
		<description><![CDATA[Ahora usted puede saber la temperatura de la sala de mi casa Bueno, seguí jugando con Sentilla Perk y Swing; Esta vez terminé de acomodar al cliente gráfico que muestra los datos en una tabla, al mismo tiempo que genera gráficos de temperatura capturados por cada sensor (código fuente aquí). Aún tengo un par de [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.flickr.com/photos/josevnz/2619388391/" title="Sentilla Swing temperature display - Time Series by josevnz, on Flickr"><img src="http://farm4.static.flickr.com/3084/2619388391_f2770d9449.jpg" alt="Sentilla Swing temperature display - Time Series" height="375" width="500" /><br />Ahora usted puede saber la temperatura de la sala de mi casa <img src='http://kodegeek.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </a></p>
<p>Bueno, seguí jugando con<a href="http://kodegeek.com/2008/05/extendiendo-el-alcance-de-sentilla.shtml"> Sentilla</a> Perk y Swing; Esta vez terminé de acomodar al cliente gráfico que muestra los datos en una tabla, al mismo tiempo que genera gráficos de temperatura capturados por cada sensor (<a href="http://elangelnegro.cvs.sourceforge.net/elangelnegro/src/java/main/com/kodegeek/blog/pervasive/perk/TemperatureGui.java?revision=1.4&amp;view=markup">código fuente aquí</a>).</p>
<p>Aún tengo un par de problemas:
<ul>
<li>No he calibrado los sensores, uno de ellos siempre mide en el rango de las 20 grados Celcius mientras que el otro está en los 30.</li>
<li><a href="http://freechart.org/">JFreeChart</a> me tiene confundido con la gráfica, tengo un problema extraño de refrescamiento de pantalla.</li>
</ul>
<p><a href="http://www.flickr.com/photos/josevnz/2619388367/" title="Sentilla Swing temperature display - raw data in table by josevnz, on Flickr"><img src="http://farm4.static.flickr.com/3167/2619388367_b09aceb23f.jpg" alt="Sentilla Swing temperature display - raw data in table" height="375" width="500" /><br />No es perfecto, pero los resultados son interesantes</a></p>
<p>Sin embargo no me tomó mucho tiempo montar esto, y cada vez se pone más divertido. Voy a preguntar a otros desarrolladores más expertos en el foro de Sentilla a ver que tal <img src='http://kodegeek.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Buscar en otros sitios:</p>
<p>Blogalaxia:<a href="http://www.blogalaxia.com/tags/kodegeek" rel="tag">kodegeek</a>, <a href="http://www.blogalaxia.com/tags/perk" rel="tag">perk</a>, <a href="http://www.blogalaxia.com/tags/sentilla" rel="tag">sentilla</a>, <a href="http://www.blogalaxia.com/tags/swing" rel="tag">swing</a>, <a href="http://www.blogalaxia.com/tags/jfreechart" rel="tag">jfreechart</a><br />Technorati:<a href="http://technorati.com/tag/kodegeek" rel="tag">kodegeek</a>, <a href="http://technorati.com/tag/perk" rel="tag">perk</a>, <a href="http://technorati.com/tag/sentilla" rel="tag">sentilla</a>, <a href="http://technorati.com/tag/swing" rel="tag">swing</a>, <a href="http://technorati.com/tag/jfreechart" rel="tag">jfreechart</a><br />To2blogs:<a href="http://www.to2blogs.com/tag/kodegeek" rel="tag">kodegeek</a>, <a href="http://www.to2blogs.com/tag/perk" rel="tag">perk</a>, <a href="http://www.to2blogs.com/tag/sentilla" rel="tag">sentilla</a>, <a href="http://www.to2blogs.com/tag/swing" rel="tag">swing</a>, <a href="http://www.to2blogs.com/tag/jfreechart" rel="tag">jfreechart</a><br />Del.icio.us:<a href="http://del.icio.us/tag/kodegeek" rel="tag">kodegeek</a>, <a href="http://del.icio.us/tag/perk" rel="tag">perk</a>, <a href="http://del.icio.us/tag/sentilla" rel="tag">sentilla</a>, <a href="http://del.icio.us/tag/swing" rel="tag">swing</a>, <a href="http://del.icio.us/tag/jfreechart" rel="tag">jfreechart</a></p>
]]></content:encoded>
			<wfw:commentRss>http://kodegeek.com/blog/2008/06/28/generando-graficos-de-temperatura-en-swing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

