<?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>SolitaryGeek &#187; swing</title>
	<atom:link href="http://solitarygeek.com/tag/swing/feed" rel="self" type="application/rss+xml" />
	<link>http://solitarygeek.com</link>
	<description>Technical Productivity</description>
	<lastBuildDate>Mon, 28 Jun 2010 03:54:10 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>What Java Look and Feel do you use?</title>
		<link>http://solitarygeek.com/java/what-java-look-and-feel-do-you-use</link>
		<comments>http://solitarygeek.com/java/what-java-look-and-feel-do-you-use#comments</comments>
		<pubDate>Mon, 09 Nov 2009 15:10:32 +0000</pubDate>
		<dc:creator>James</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Polls]]></category>
		<category><![CDATA[look and feel]]></category>
		<category><![CDATA[swing]]></category>
		<category><![CDATA[themes]]></category>

		<guid isPermaLink="false">http://www.solitarygeek.com/?p=519</guid>
		<description><![CDATA[<p>Quite some time back, I read an article titled &#8220;20+ Free Look and Feel Libraries For Java Swing&#8220;. I have evaluated most of the libraries mentioned in that article. Personally, I  prefer the System look and feel that is bundled in the JRE. However, I like Substance, PGS and JGoodies as well. Which one do you <span style="color:#777"> . . . &#8594; Read More: <a href="http://solitarygeek.com/java/what-java-look-and-feel-do-you-use">What Java Look and Feel do you use?</a></span>]]></description>
			<content:encoded><![CDATA[<p>Quite some time back, I read an article titled &#8220;<a href="http://javabyexample.wisdomplug.com/web-programming/37-core-java/65-20-free-look-and-feel-libraries-for-java-swings.html">20+ Free Look and Feel Libraries For Java Swing</a>&#8220;. I have evaluated most of the libraries mentioned in that article. Personally, I  prefer the System look and feel that is bundled in the JRE. However, I like Substance, PGS and JGoodies as well. Which one do you use? Curious to know.</p>
Note: There is a poll embedded within this post, please visit the site to participate in this post's poll.
]]></content:encoded>
			<wfw:commentRss>http://solitarygeek.com/java/what-java-look-and-feel-do-you-use/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Implementing session timeout in swing apps</title>
		<link>http://solitarygeek.com/java/implementing-session-timeout-in-swing-apps</link>
		<comments>http://solitarygeek.com/java/implementing-session-timeout-in-swing-apps#comments</comments>
		<pubDate>Mon, 03 Dec 2007 14:06:00 +0000</pubDate>
		<dc:creator>James</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[swing]]></category>

		<guid isPermaLink="false">http://jamesselvakumar.wordpress.com/2007/12/03/implementing-session-timeout-in-swing-apps/</guid>
		<description><![CDATA[<p>If you are working in a web based project, the term &#8220;session&#8221; must be a frequently used one. &#8220;I want to implement a HttpSessionListener&#8221;, &#8220;How do I access http session?&#8221;,  &#8220;Should i store my user state in http session or in a session bean?&#8221;.</p>
<p>But I just wondered, how to implement that in a swing application? <span style="color:#777"> . . . &#8594; Read More: <a href="http://solitarygeek.com/java/implementing-session-timeout-in-swing-apps">Implementing session timeout in swing apps</a></span>]]></description>
			<content:encoded><![CDATA[<p>If you are working in a web based project, the term &#8220;session&#8221; must be a frequently used one. &#8220;I want to implement a HttpSessionListener&#8221;, &#8220;How do I access http session?&#8221;,  &#8220;Should i store my user state in http session or in a session bean?&#8221;.</p>
<p>But I just wondered, how to implement that in a swing application? (Sorry, i haven&#8217;t learn swing application framework yet)</p>
<p>Consider this typical scenario:<br />
A user has logged into the swing application and has opened some 2 or three windows (JFrames). Now the user goes somewhere leaving the system idle.<br />
How can we logout the user automatically here (for security reasons)?<br />
How to close the opened resources?</p>
<p>I initially thought of writing a global event listener and implementing that in all the user interface classes. But that looked like a bad idea for me, because that would involve a lot of code changes.</p>
<p>So I searched through the net and found out a solution from a java forum (thanks camickr).<br />
In contrast to my expectations, it was quite simple though. And here it is:</p>
<p><span style="font-family:courier new;"> private void trackSystemEvents()</span><br />
<span style="font-family:courier new;">    {</span><br />
<span style="font-family:courier new;">        Toolkit.getDefaultToolkit().addAWTEventListener(new AWTEventListener()</span><br />
<span style="font-family:courier new;">        {</span><br />
<span style="font-family:courier new;">            public void eventDispatched(AWTEvent event)</span><br />
<span style="font-family:courier new;">            {</span><br />
<span style="font-family:courier new;">                String eventText = event.toString();</span><br />
<span style="font-family:courier new;">                if(eventText.indexOf(&#8220;PRESSED&#8221;) != -1 ||  eventText.indexOf(&#8220;RELEASED&#8221;) != -1)</span><br />
<span style="font-family:courier new;">                {</span><br />
<span style="font-family:courier new;">                    SessionMonitor.getInstance().setLastActionTime(System.currentTimeMillis());</span><br />
<span style="font-family:courier new;">                }</span><br />
<span style="font-family:courier new;">            }</span><br />
<span style="font-family:courier new;">        }, AWTEvent.MOUSE_EVENT_MASK + AWTEvent.KEY_EVENT_MASK);</span><br />
<span style="font-family:courier new;">    }</span></p>
<p>Here, i want to track the user activity through a &#8220;global&#8221; listener kind of thing. And here the event listener is registered with <span style="font-family:courier new;">AWTEvent.MOUSE_EVENT_MASK and AWTEvent.KEY_EVENT_MASK. That means, only mouse events and key events shall be tracked.</span></p>
<p>And i don&#8217;t want to track the mouse moved/entered events and that&#8217;s why the small &#8220;if&#8221; condition which checks only for &#8220;pressed/released&#8221; actions like key pressed, mouse released etc.</p>
<p>This will help you in implementing the logic to track session timeout.</p>
<p>And spice it up with &#8220;observer&#8221; pattern to notify your user interfaces to close the opened resources.</p>
]]></content:encoded>
			<wfw:commentRss>http://solitarygeek.com/java/implementing-session-timeout-in-swing-apps/feed</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
	</channel>
</rss>
