<?xml version="1.0" encoding="utf-8"?>




<rss version="2.0">
    <channel>
        <title>The Wannabe Java Rockstar; Category: Java</title>
        <link>http://weblog.janek.org/</link>
        <description>The Wannabe Java Rockstar: Janek's weblog where all posts go to Eleven</description>
        <copyright>(c) 2004, 2005 Janek Schwarz</copyright>
        <generator>Fog Creek CityDesk 2.0</generator>
        
        <category>Java</category>
        
        <lastBuildDate>Fri, 25 Jan 2008 20:10:39 +0100</lastBuildDate>
        <managingEditor>weblog@janek.org</managingEditor>
        <webMaster>weblog@janek.org</webMaster>
        <language>en-us</language>

        
    <item>
    <title>The state of client-side Java HTML rendering</title>
    <category>Java</category>
	<description><![CDATA[<p>I don't know if this thing is still read by people. In any case, I need a solution for HTML rendering in Java desktop application. Currently, my application uses <a href="http://www.netcluesoft.com/">NetClue</a>, but the company seems to be defunct. Well, NetClue has always been a bit flaky when it comes to in-the-wild-HTML, but it wasn't that much of a problem as we control the HTML generation.</p>
<p>But now the application needs to consume "third-party generated" HTML code too. And NetClue tends to stall the whole application when it encounters HTML it doesn't like.</p>
<p>So I'm looking for alternatives, pure Java ones preferred. What HTML renderes are available and what are the licensing options?</p>]]></description>
	
	
	<link>http://weblog.janek.org/Archive/2006/08/02/Thestateofclient-sideJava.html</link>
	<guid>http://weblog.janek.org/Archive/2006/08/02/Thestateofclient-sideJava.html</guid>
	
	
	

    <pubDate>Wed, 02 Aug 2006 23:07:58 +0100</pubDate>
    
    
    <comments>http://enetation.co.uk/comments.php?user=speedball2001&amp;commentid=060802230758</comments>
    

    
  </item>

    <item>
    <title>Kitikat: Why Should I Use It?</title>
    <category>Java</category>
	<description><![CDATA[<p>I found the <a href="http://www.kitikat.org/">Kitikat framework</a> via <a href="http://www.thauvin.net/linkblog/?date=2005-08-10#Beat:453">Erik's linkblog</a>. "Funny name, let's check It out" I thought. The problem is: I studied the whole web site and I still don't know what this thing is about. It states</p>
<blockquote><p>The Kitikat Java Framework is a powerful but simple Datastore processing framework.</p>
<p>A Datastore represents an in-memory copy of data. A program may retrieve the data from a data source, such as a relational database, manipulate the data and then propagate the updates of the data back to the original data source or to a different data source. Once the data is retrieved, it is a disconnected, data source independent version of the data. A change history of the data is maintained to provide dynamic updates to a data source and there are several levels of concurrency control provided for multi-user environments.</p>
</blockquote>
<p>It goes on with a list of features, supported application servers and a quick start guide.</p>
<p>The most important thing this web sites lacks is the answers to questions such as</p>
<ul>
<li>Why should I want to use this software?
</li>
<li>What kind of problems does it help me solve?
</li>
<li>Why is it better than product X, Y and Z?
</li>
</ul>
<p>I'm pretty sure the developers of Kitikat know the answers. They must have thought of typical use cases and applications. It's a shame that the web site doesn't communicate it.</p>
<p>I don't want to pick specifically on the Kitikat guys. It's just that I read the blurb on the front page, scanned the documentation and went "Huh?". I'd really like to know what I could do with it.</p>]]></description>
	
	
	<link>http://weblog.janek.org/Archive/2005/08/10/KitikatWhyShouldIUseIt.html</link>
	<guid>http://weblog.janek.org/Archive/2005/08/10/KitikatWhyShouldIUseIt.html</guid>
	
	
	

    <pubDate>Wed, 10 Aug 2005 21:25:09 +0100</pubDate>
    
    
    <comments>http://enetation.co.uk/comments.php?user=speedball2001&amp;commentid=050810212509</comments>
    

    
  </item>

    <item>
    <title>The History of Ant</title>
    <category>Java</category>
	<description><![CDATA[<p><a href="http://www.codefeed.com/blog/">Conor</a>&nbsp;gives a fascinating <a href="http://codefeed.com/blog/?p=98">summary</a> of the development of Ant. I found the bits about Ant2 particularly interesting. Devoted followers of ant-dev might already know that several efforts competed to become Ant2. All of them have died.</p>
<p>Instead, the developers decided to evolutionary improve Ant 1.x.</p>
<p>Good read.</p>]]></description>
	
	
	<link>http://weblog.janek.org/Archive/2005/08/05/TheHistoryofAnt.html</link>
	<guid>http://weblog.janek.org/Archive/2005/08/05/TheHistoryofAnt.html</guid>
	
	
	

    <pubDate>Fri, 05 Aug 2005 00:11:20 +0100</pubDate>
    
    
    <comments>http://enetation.co.uk/comments.php?user=speedball2001&amp;commentid=050805001120</comments>
    

    
  </item>

    <item>
    <title>The Best Way to Add a Context Menu to Text Components</title>
    <category>Java</category>
	<description><![CDATA[<p>There's an excellent <a href="http://www.javalobby.org/java/forums/m91840438.html">discussion</a> over at Javalobby on how to add context menus to text components in Swing. In Windows, textfields have a context menu with entries suchs as cut, copy, and paste,&nbsp;&nbsp;which is not available in Swing's Windows look and feel.</p>
<p>Surprisingly enough, the discussion is pretty civilised and lacks the typical "Sun will never get native fidelity right" and "Stuff like that makes my Swing application look unprofessional" posts.</p>]]></description>
	
	
	<link>http://weblog.janek.org/Archive/2005/07/29/TheBestWaytoAddaContextMe.html</link>
	<guid>http://weblog.janek.org/Archive/2005/07/29/TheBestWaytoAddaContextMe.html</guid>
	
	
	

    <pubDate>Fri, 29 Jul 2005 23:44:06 +0100</pubDate>
    
    
    <comments>http://enetation.co.uk/comments.php?user=speedball2001&amp;commentid=050729234406</comments>
    

    
  </item>

    <item>
    <title>Alternatives to Java Native Interface (JNI)</title>
    <category>Java</category>
	<description><![CDATA[<p>Inspired by the <a href="http://www.javalobby.org/java/forums/t19828.html">announcement</a> of <a href="http://www.excelsior-usa.com/xfunction.html">xFunction</a>, I searched the web for libraries that ease the use of native code. As it turns out, it's quite a few.</p>
<h4>Libraries for simplifying JNI</h4>
<ul>
<li><a href="http://sourceforge.net/projects/jace/">Jace</a>
</li>
<li><a href="http://www.jniwrapper.com">JNIWrapper</a>
</li>
<li><a href="http://nativecall.sourceforge.net/">NativeCall</a>
</li>
<li><a href="http://www.noodleglue.org/">Noodleglue</a>
</li>
<li><a href="http://www.smardec.com/products/j2native.html">J2Native</a>
</li>
<li><a href="http://simtel.net/product.php%5Bid%5D90910%5BSiteID%5Dsimtel.net">OOJNI</a>
</li>
<li><a href="http://www.excelsior-usa.com/xfunction.html">xFunction</a>
</li>
</ul>
<h4>Java/COM integration</h4>
<ul>
<li><a href="https://com4j.dev.java.net/">com4j</a>
</li>
<li><a href="http://www.jniwrapper.com/pages/comfyj/overview">ComfyJ</a> (spin-off of <a href="http://www.jniwrapper.com">JNIWrapper</a>)</li>
<li><a href="http://www.ezjcom.com/">EZ JCom</a>
</li>
<li><a href="http://www.alphaworks.ibm.com/tech/bridge2java">Interfacetool for Java</a>
</li>
<li><a href="http://j-integra.intrinsyc.com/products/com/">J-Integra for COM</a>
</li>
<li><a href="http://j-interop.sourceforge.net/">j-Interop</a>
</li>
<li><a href="http://danadler.com/jacob/">Jacob</a>
</li>
<li><a href="http://www.jacozoom.com/en_jacoZoom.shtml">jacoZoom</a>
</li>
<li><a href="http://www.nevaobject.com/_docs/_java2com/java2com.htm">Java2COM</a>
</li>
<li><a href="http://jawinproject.sourceforge.net/">Jawin</a>
</li>
<li><a href="http://www.nexb.org/open-source-it-asset-management/Wiki.jsp?page=Jcom">JCom</a>
</li>
<li><a href="http://www.javain.com/javain/oleja.jsp">OLEJA</a>
</li>
</ul>
<p>Of these toolkits, J-Integra and j-Interop stand out. They integrate Java with COM in pure Java. By talking to COM components over TCP/IP, J-Integra and j-Interop even work on non-Microsoft plattforms.
</p>
<h4>Special interest</h4>
<p>There are various libraries available that provide access to specific functionality on Windows. Many of those could be replaced by the likes of JNIWrapper. Nevertheless, I included them for completeness.</p>
<ul>
<li><a href="http://www.trustice.com/java/jnireg/">JNIRegistry</a>
</li>
<li><a href="http://www.bayequities.com/tech/Products/jreg_key.shtml">jRegistryKey</a>
</li>
<li><a href="http://www.held-mueller.de/JMatLink/">JMatLink</a>
</li>
<li><a href="http://tolstoy.com/samizdat/jconfig.html">JConfig</a>
</li>
<li><a href="http://www.javaapis.com/jdun/">JDun</a>
</li>
<li><a href="http://www.javaapis.com/jflashplayer/">JFlashplayer</a>
</li>
<li><a href="http://www.javaapis.com/jiebrowser/">JIEBrowser</a>
</li>
<li><a href="http://www.javaapis.com/jtray/">JTray</a>
</li>
<li><a href="http://members.lycos.co.uk/gciubotaru/systray/">Java Systray Manager</a>
</li>
<li><a href="http://systray.sourceforge.net/">SysTray for Java</a>
</li>
</ul>
<p>Nota bene: I think it's pretty obvious that the Java community lacks creativity when it comes to product names. We really should stop naming our products "JSomething" or "Something4j".</p>
<p>Update(29.01.06): Included NativeCall and OLEJA.</p>
<p>Update(16.09.06): Included ComfyJ and j-Interop.</p>]]></description>
	
	
	<link>http://weblog.janek.org/Archive/2005/07/28/AlternativestoJavaNativeI.html</link>
	<guid>http://weblog.janek.org/Archive/2005/07/28/AlternativestoJavaNativeI.html</guid>
	
	
	

    <pubDate>Thu, 28 Jul 2005 23:45:18 +0100</pubDate>
    
    
    <comments>http://enetation.co.uk/comments.php?user=speedball2001&amp;commentid=050728234518</comments>
    

    
  </item>

    <item>
    <title>JNIWrapper has new Web site</title>
    <category>Java</category>
	<description><![CDATA[<p><a href="http://www.jniwrapper.com">JNIWrapper</a>, my <a href="../../Archive/2004/06/27/JNIWrapper-JavaDesktopInt.html">library of choice</a> when it comes to Java Desktop Integration, unveiled a new website. Finally, they have <a href="http://www.jniwrapper.com/pages/forums/forumsMain">support forums</a>.</p>
<p>Since JNIWrapper is commercial, it's difficult to find help on the web. Their support is exceptional, but for getting in contact with other users, getting help or advice I prefer to use a forum.</p>
<p>Now they only need to support RSS and I'm lucky.</p>
<p><strong>Update:</strong> I <a href="http://www.jniwrapper.com/pages/forums/forumsThread?threadRootMessage=4">asked</a>. RSS will be available in late August.</p>]]></description>
	
	
	<link>http://weblog.janek.org/Archive/2005/07/25/JNIWrapperHasNewWebsite.html</link>
	<guid>http://weblog.janek.org/Archive/2005/07/25/JNIWrapperHasNewWebsite.html</guid>
	
	
	

    <pubDate>Mon, 25 Jul 2005 00:28:37 +0100</pubDate>
    
    
    <comments>http://enetation.co.uk/comments.php?user=speedball2001&amp;commentid=050725002837</comments>
    

    
  </item>

    <item>
    <title>Psycho Test</title>
    <category>General, Javablogs</category>
	<description><![CDATA[<p>This was emailed to me. If you got it right, I don't want to know you! Here we go:</p>
<blockquote>
<p>A woman, while at the funeral of her own mother, met this guy whom she did not know. &nbsp;She thought this guy was amazing, so much her dream guy, she believed him to be just that! &nbsp;She fell in love with him right there, but never asked for his number and could not find him. &nbsp;A few days later she killed her sister.&nbsp;</p>
<p>Question: What is her motive in killing her sister?</p>
</blockquote>
<p>Give this some thought, before you answer. Then <a href="../../Archive/2005/04/09/PsychoTestAnswer.html">proceed</a>.</p>]]></description>
	
	
	<link>http://weblog.janek.org/Archive/2005/04/09/PsychoTest.html</link>
	<guid>http://weblog.janek.org/Archive/2005/04/09/PsychoTest.html</guid>
	
	
	

    <pubDate>Sat, 09 Apr 2005 13:10:57 +0100</pubDate>
    
    
    <comments>http://enetation.co.uk/comments.php?user=speedball2001&amp;commentid=050409131057</comments>
    

    
  </item>

    <item>
    <title>Access COM objects with Java</title>
    <category>Java</category>
	<description><![CDATA[<p><a href="http://radio.javaranch.com/val/">Val</a> has a nice article about <a href="http://radio.javaranch.com/val/2005/04/07/1112864761792.html">accessing COM objects with Java</a>. Using <a href="http://j-integra.intrinsyc.com/">J-Integra's COM-Java-Bridge</a>, he shows how to feed data into Excel and generate charts.</p>
<p>I've <a href="../../Archive/2004/10/26/HowtoprintPDFdocumentswit.html">already</a> <a href="../../Archive/2004/06/27/JNIWrapper-JavaDesktopInt.html">written</a> about COM-Java-integration with <a href="http://www.jniwrapper.com">JNIWrapper</a>, my tool of choice. It's great to see more and more articles pop up about it. I guess it has to do with the resurgence of Desktop Java.</p>]]></description>
	
	
	<link>http://weblog.janek.org/Archive/2005/04/07/AccessCOMobjectswithJava.html</link>
	<guid>http://weblog.janek.org/Archive/2005/04/07/AccessCOMobjectswithJava.html</guid>
	
	
	

    <pubDate>Thu, 07 Apr 2005 23:39:35 +0100</pubDate>
    
    
    <comments>http://enetation.co.uk/comments.php?user=speedball2001&amp;commentid=050407233935</comments>
    

    
  </item>

    <item>
    <title>When Unit Tests Go Bad Over Time</title>
    <category>Java</category>
	<description><![CDATA[<p>Today I had one of those I-didn't-change-anything-why-did-it-stop-working moments. Out of a sudden a unit test broke. I went back to the latest known working state, I checked out an older release from CVS -- it still broke. Something weird was going on: the release process makes sure that every unit test passes before creating a new release. Effectively, the past had changed.</p>
<p>The tested class is a somewhat complex piece of code for managing X.509 certificate chains. It makes sure that the chain is valid, that every single certificate is electronically signed, that the certificates aren't expired. And that's what happened: one of the certificates used to test this class expired.</p>
<p>The worst thing isn't the time wasted while trying to debug the problem; it's that we can't use older releases as-is.</p>
<p>I wonder what I can do in order to avoid it in the future. The nature of the tested code, the test arguments and the environment might make it hard. I can't just create a new X.509 certificate during test setup as it has to be signed by a certificate authority.</p>
<p>Any of you unit test gurus have an idea?</p>]]></description>
	
	
	<link>http://weblog.janek.org/Archive/2005/03/22/WhenUnitTestsGoBadOverTim.html</link>
	<guid>http://weblog.janek.org/Archive/2005/03/22/WhenUnitTestsGoBadOverTim.html</guid>
	
	
	

    <pubDate>Tue, 22 Mar 2005 20:54:35 +0100</pubDate>
    
    
    <comments>http://enetation.co.uk/comments.php?user=speedball2001&amp;commentid=050322205435</comments>
    

    
  </item>

    <item>
    <title>Fighting Referer Spam. Round 2.</title>
    <category>Blogging, Javablogs</category>
	<description><![CDATA[<p>I'm at a point where my referer logs simply become useless. I don't publish them on the web but get hit anyway. For about a month I tried to battle it with <a href="../../Archive/2005/02/02/FightingRefererSpam.html">.htaccess and mod_rewrite</a> but I feel I'm loosing.</p>
<p>OK, I can't prevent referer spam from hitting my site. But I can filter the log file later. <a href="http://www.juju.org/archives/2005/01/21/derefspam">Derefspam</a>&nbsp;does exactly that. It cleans the log file using the blacklist maintained by <a href="http://www.jayallen.org/comment_spam/">MT-Blacklist</a>. It works surprisingly well.</p>]]></description>
	
	
	<link>http://weblog.janek.org/Archive/2005/02/24/FightingRefererSpam.Round.html</link>
	<guid>http://weblog.janek.org/Archive/2005/02/24/FightingRefererSpam.Round.html</guid>
	
	
	

    <pubDate>Thu, 24 Feb 2005 21:48:25 +0100</pubDate>
    
    
    <comments>http://enetation.co.uk/comments.php?user=speedball2001&amp;commentid=050224214825</comments>
    

    
  </item>

    <item>
    <title>Resources for Automatic Updates of Java Applications</title>
    <category>Java</category>
	<description><![CDATA[<p>On my <a href="../../Archive/2005/02/01/HowDoYouDeliverUpdatesToU.html">quest</a> for tools that help with automatic updates of Java applications I found a couple of articles, tools and libraries:</p>

<h4>Articles</h4>
<ul>
<li><a href="http://www.javaworld.com/javaworld/jw-11-2002/jw-1122-autoupdate.html">Update distributed applications</a>
- Article at Javaworld comparing three solutions for auto-updating Java applications: Java Web Start, Quest DeployDirector and PowerUpdate.
</li>
<li><a href="http://www.ftponline.com/javapro/2003_06/magazine/features/mnadelson/">Make Applications Update-Aware</a>
- Employ Java Web Start to place JAR files on a web server to facilitate error-free update
</li>
</ul><h4>Solutions</h4>
<ul>
<li><a href="http://java.sun.com/products/javawebstart/">Java Web Start</a>
</li>
<li>ZeroG <a href="http://zerog.com/products_pu.shtml">PowerUpdate</a>
</li>
<li>InstallShield <a href="http://www.installshield.com/products/updateservice/">UpdateService</a>
</li>
<li>Quest <a href="http://www.quest.com/deploydirector/index.asp">DeployDirector</a>
</li>
<li><a href="http://sourceforge.net/projects/autoupdater/">AutoUpdater</a>
</li>
<li><a href="http://sourceforge.net/projects/stableupdate/">stableUpdate</a>
</li>
<li><a href="http://sourceforge.net/projects/jauus/">Java Application Update Utility Software</a>
</li>
<li><a href="http://sourceforge.net/projects/jrunner/">JRunner</a>
</li>
</ul><p>Most of the comments and several emails suggested Java Web Start. I still don't know enough about it. Most of our users don't have Java installed. To take care of that our application comes with it's own JVM.&nbsp;&nbsp;It is private and not registered with the system. I have no clue how to integrate that with Web Start/JNLP. The <a href="http://java.sun.com/products/javawebstart/faq.html">FAQ</a> doesn't help.</p>
<p>Anyway, next step: evaluation.</p>]]></description>
	
	
	<link>http://weblog.janek.org/Archive/2005/02/03/ResourcesforAutomaticUpda.html</link>
	<guid>http://weblog.janek.org/Archive/2005/02/03/ResourcesforAutomaticUpda.html</guid>
	
	
	

    <pubDate>Thu, 03 Feb 2005 22:30:47 +0100</pubDate>
    
    
    <comments>http://enetation.co.uk/comments.php?user=speedball2001&amp;commentid=050203223047</comments>
    

    
  </item>

    <item>
    <title>How Do You Deliver Updates To Users?</title>
    <category>Java</category>
	<description><![CDATA[<p>I need to deliver updates to my customers. Are there any best practices, techniques or tools available that help with this process?</p>
<p>We develop in Java; the applications are deployed using a traditional graphical installer. When we need to deliver bugfixes, we&nbsp; use a simplistic approach:</p><code>diff -r -q -N $OLD_RELEASE_DIR $NEW_RELEASE_DIR | awk '{print $4}' | zip -r
$ARCHIVE_NAME -@</code><p>The command compares two directories and adds every differing file to a zip file. Later, this file is wrapped in a self-extractor and sent to the customer. Of course, this works only if the new release doesn't contain any incompatibilities.</p>
<p>In the foreseeable future, we need to deliver more complex updates, possibly introducing changes in the data format.</p>
<p>So my questions are:</p>
<ul>
<li>How do you manage changes and incompatibilities?
</li>
<li>Do tools exist that support the process or automate it?
</li>
<li>After you've identified every change that needs to make it into the update, how do you deliver it?
</li>
<li>Besides Webstart, are there any Java-based solutions available for automatic updating?
</li>
</ul>
<p>Every hint is appreciated.</p>]]></description>
	
	
	<link>http://weblog.janek.org/Archive/2005/02/01/HowDoYouDeliverUpdatesToU.html</link>
	<guid>http://weblog.janek.org/Archive/2005/02/01/HowDoYouDeliverUpdatesToU.html</guid>
	
	
	

    <pubDate>Tue, 01 Feb 2005 20:32:11 +0100</pubDate>
    
    
    <comments>http://enetation.co.uk/comments.php?user=speedball2001&amp;commentid=050201203211</comments>
    

    
  </item>

    <item>
    <title>Ant and Due Diligence</title>
    <category>Java</category>
	<description><![CDATA[<p>Today, I received an email from Matt Besson. He's one of the Ant submitters. Matt asked for the right to include one of my <a href="../../Archive/2004/12/20/ExceptionWhenWritingToAFu.html">code snippets</a> in Ant's codebase. I agreed, of course.</p>
<p>Not that I care about stuff like that, but I'm pleased he asked for permission.&nbsp;It shows that these guys are careful when it comes to taking code from the net -- even if it's just one line.</p>]]></description>
	
	
	<link>http://weblog.janek.org/Archive/2005/01/19/AntandDueDilIgence.html</link>
	<guid>http://weblog.janek.org/Archive/2005/01/19/AntandDueDilIgence.html</guid>
	
	
	

    <pubDate>Wed, 19 Jan 2005 23:28:56 +0100</pubDate>
    
    
    <comments>http://enetation.co.uk/comments.php?user=speedball2001&amp;commentid=050119232856</comments>
    

    
  </item>

    <item>
    <title>How to Sort Files and Directories</title>
    <category>Java</category>
	<description><![CDATA[<p>Via Technorati's new <a href="http://www.technorati.com/tag/java">tag</a> feature I found a quick and dirty algorithm for <a href="http://www.aikidoforum.de/kopis/index.php?p=141">sorting files and directories</a>. The author asked for improved versions. Here's mine:</p><tt class="java"><font class="java4">import </font><font class="java10">java.io.File;<br />
</font><font class="java4">import </font><font class="java10">java.text.Collator;<br />
</font><font class="java4">import </font><font class="java10">java.util.Arrays;<br />
</font><font class="java4">import </font><font class="java10">java.util.Comparator;<br />
<br />
</font><font class="java4">public class </font><font class="java10">FileSort<br />
</font><font class="java8">{<br />
</font><font class="java4">public static </font><font class="java9">void </font><font class="java10">main</font><font class="java8">(</font><font class="java10">String</font><font class="java8">[] </font><font class="java10">args</font><font class="java8">)<br />
{<br />
&nbsp; </font><font class="java10">File dir = </font><font class="java4">new </font><font class="java10">File</font><font class="java8">(</font><font class="java5">"D:/home/schwarz/Eigene Dateien"</font><font class="java8">)</font><font class="java10">;<br />
&nbsp; File</font><font class="java8">[] </font><font class="java10">selectedFiles = dir.listFiles</font><font class="java8">()</font><font class="java10">;<br /><br />
&nbsp; </font><font class="java4">if</font><font class="java8">(</font><font class="java10">selectedFiles != </font><font class="java4">null</font><font class="java8">)<br />
&nbsp;&nbsp;&nbsp; {<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </font><font class="java4">for</font><font class="java8">(</font><font class="java9">int </font><font class="java10">i = </font><font class="java7">0</font><font class="java10">; i &lt; selectedFiles.length; i++</font><font class="java8">)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </font><font class="java10">System.err.println</font><font class="java8">(</font><font class="java10">selectedFiles</font><font class="java8">[</font><font class="java10">i</font><font class="java8">])</font><font class="java10">;<br />
<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Arrays.sort</font><font class="java8">(</font><font class="java10">selectedFiles, </font><font class="java4">new </font><font class="java10">FileComparator</font><font class="java8">())</font><font class="java10">;<br />
<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </font><font class="java4">for</font><font class="java8">(</font><font class="java9">int </font><font class="java10">i = </font><font class="java7">0</font><font class="java10">; i &lt; selectedFiles.length; i++</font><font class="java8">)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </font><font class="java10">System.err.println</font><font class="java8">(</font><font class="java10">selectedFiles</font><font class="java8">[</font><font class="java10">i</font><font class="java8">])</font><font class="java10">;<br />
&nbsp;&nbsp;&nbsp; </font><font class="java8">}<br />
}<br />
<br />
</font><font class="java4">private static class </font><font class="java10">FileComparator<br />
&nbsp; </font><font class="java4">implements </font><font class="java10">Comparator<br />
</font><font class="java8">{<br />
</font><font class="java4">private </font><font class="java10">Collator c = Collator.getInstance</font><font class="java8">()</font><font class="java10">;<br />
<br />
</font><font class="java4">public </font><font class="java9">int </font><font class="java10">compare</font><font class="java8">(</font><font class="java10">Object o1,<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Object o2</font><font class="java8">)<br />
{<br />
&nbsp; </font><font class="java4">if</font><font class="java8">(</font><font class="java10">o1 == o2</font><font class="java8">)<br />
&nbsp;&nbsp;&nbsp; </font><font class="java4">return </font><font class="java7">0</font><font class="java10">;<br />
<br />
&nbsp; File f1 = </font><font class="java8">(</font><font class="java10">File</font><font class="java8">) </font><font class="java10">o1;<br />
&nbsp; File f2 = </font><font class="java8">(</font><font class="java10">File</font><font class="java8">) </font><font class="java10">o2;<br />
<br />
&nbsp; </font><font class="java4">if</font><font class="java8">(</font><font class="java10">f1.isDirectory</font><font class="java8">() </font><font class="java10">&amp;&amp; f2.isFile</font><font class="java8">())<br />
&nbsp;&nbsp;&nbsp; </font><font class="java4">return </font><font class="java10">-</font><font class="java7">1</font><font class="java10">;<br />
&nbsp; </font><font class="java4">if</font><font class="java8">(</font><font class="java10">f1.isFile</font><font class="java8">() </font><font class="java10">&amp;&amp; f2.isDirectory</font><font class="java8">())<br />
&nbsp;&nbsp;&nbsp; </font><font class="java4">return </font><font class="java7">1</font><font class="java10">;<br />
<br />
&nbsp; </font><font class="java4">return </font><font class="java10">c.compare</font><font class="java8">(</font><font class="java10">f1.getName</font><font class="java8">()</font><font class="java10">, f2.getName</font><font class="java8">())</font><font class="java10">;<br />
</font><font class="java8">}<br />
}<br />
}</font></tt><p><br /><strong>Update:</strong></p>
<p>I was a bit lazy with error handling. Usually, I'm <em>totally</em> not like that ;-). Thank you, Peter, for reminding me in the comments that listFiles() can return a null value.</p>]]></description>
	
	
	<link>http://weblog.janek.org/Archive/2005/01/16/HowtoSortFilesandDirector.html</link>
	<guid>http://weblog.janek.org/Archive/2005/01/16/HowtoSortFilesandDirector.html</guid>
	
	
	

    <pubDate>Sun, 16 Jan 2005 23:15:33 +0100</pubDate>
    
    
    <comments>http://enetation.co.uk/comments.php?user=speedball2001&amp;commentid=050116231533</comments>
    

    
  </item>

    <item>
    <title>Company Names That Should Be Forbidden</title>
    <category>General, Javablogs</category>
	<description><![CDATA[<p>I know I have a sick little mind. But still, one shouldn't call a company <a href="http://www.snecma.com/en/group/index.php">Snecma</a>.</p>
<p>I should turn this into a series.</p>]]></description>
	
	
	<link>http://weblog.janek.org/Archive/2005/01/15/CompanyNamesThatShouldBeF.html</link>
	<guid>http://weblog.janek.org/Archive/2005/01/15/CompanyNamesThatShouldBeF.html</guid>
	
	
	

    <pubDate>Sat, 15 Jan 2005 00:37:01 +0100</pubDate>
    
    
    <comments>http://enetation.co.uk/comments.php?user=speedball2001&amp;commentid=050115003701</comments>
    

    
  </item>

    <item>
    <title>Stellenangebot für einen Java-Entwickler in Berlin</title>
    <category>Java</category>
	<description><![CDATA[<p>Mein Arbeitgeber sucht einen erfahrenen Java-Entwickler. Die Aufgabe umfasst Design und Entwicklung von J2EE-Anwendungen. Hinzu kommen Wartung und Erweiterung bestehender Systeme.</p>
<p>Der ideale Kandidat hat</p>
<ul>
<li>mehrere Jahre Erfahrung mit J2EE-Applikationen (JSP, Servlets, Enterprise Beans, JMS)
</li>
<li>mehrere Jahre Erfahrung mit Entwurf, Entwicklung und Optimierung von Datenbankanwendungen. Von Vorteil sind Kenntnisse in der Datenbankprogrammierung unter Java mit JDBC und OR-Mappern wie Castor JDO oder Hibernate.
</li>
<li>Routine im Umgang mit XML-Technologien: XML 1.0, XSLT, XML Schema
</li>
<li>gute Englischkenntnisse
</li>
</ul>
<p>Bonuspunkte gibt es für</p>
<ul>
<li>Kenntniss weiterer Programmier- und Skriptsprachen (C/C++, Python, Perl, Awk, Shell)
</li>
<li>Erfahrung mit JBoss und PostgreSQL
</li>
<li>Praxis im Umgang mit alternativen Frameworks zur Entwicklung von Webapplikationen, insbesondere ZOPE</li>
</ul>
<p>Mein persönlicher Favorit hat außerdem eine schöne Musiksammlung.</p>
<p>Wir sind eine kleine, knuffige Firma mit Sitz in Berlin (Mitte).</p>
<p>Interessenten können mir eine <a href="mailto:janek@janek.org">Email</a> mit den üblichen Bewerbungsunterlagen im PDF-Format&nbsp; senden; ich kümmere mich um die Details.</p>
<p>Dear English reader: my employer looks for an experienced Java developer in Berlin/Germany. Should you&nbsp; know someone, please refer him to me.</p>]]></description>
	
	
	<link>http://weblog.janek.org/Archive/2005/01/11/StellenangebotfureinenJav.html</link>
	<guid>http://weblog.janek.org/Archive/2005/01/11/StellenangebotfureinenJav.html</guid>
	
	
	

    <pubDate>Tue, 11 Jan 2005 20:03:25 +0100</pubDate>
    
    
    <comments>http://enetation.co.uk/comments.php?user=speedball2001&amp;commentid=050111200325</comments>
    

    
  </item>

    <item>
    <title>Creating Professionally Looking .NET Applications</title>
    <category>Java</category>
	<description><![CDATA[<p>The world is turning upside down. People in the Joel on Software forum <a href="http://discuss.joelonsoftware.com/default.asp?design.4.54306">ask</a> for professionally looking look and feels for .NET applications -- comparable to Java look and feel implementations:</p>
<blockquote>I have started developing a windows application in C# using the express c# visual studio ide.  It is a simple application, similar to many chat clients.  While I can do all the logic and lay out components on the GUI, I'm horrified at how ugly it looks!  I've done a small number of GUIs in Java as well, but there are some very nice L&amp;Fs for Java which turn an average GUI into something nice ...</blockquote>
<p>So what is it with us Java developers?&nbsp;&nbsp;We always whine about the lousy looking desktop applications; at the same time, .NET developers are jealous of our variety of look and feels.</p>
<p>Something is wrong in Javaland.</p>]]></description>
	
	
	<link>http://weblog.janek.org/Archive/2005/01/06/CreatingProfessionalyLook.html</link>
	<guid>http://weblog.janek.org/Archive/2005/01/06/CreatingProfessionalyLook.html</guid>
	
	
	

    <pubDate>Thu, 06 Jan 2005 23:49:52 +0100</pubDate>
    
    
    <comments>http://enetation.co.uk/comments.php?user=speedball2001&amp;commentid=050106234952</comments>
    

    
  </item>

    <item>
    <title>Exception When Writing To A Full Disk? Not In Java!</title>
    <category>Java</category>
	<description><![CDATA[<p>Have you ever hoped to get an exception when writing to a full disk in Java? Get ready to be disappointed.</p>
<p>Execute this code on a full disk (on Linux/Unix, you can simulate it with hard quota):</p><p><tt class="java"><font class="java10">FileOutputStream ostream = </font><font class="java4">new </font><font class="java10">FileOutputStream</font><font class="java8">(</font><font class="java5">"out"</font><font class="java8">)</font><font class="java10">;<br />
ostream.write</font><font class="java8">(</font><font class="java5">"hello"</font><font class="java10">.getBytes</font><font class="java8">())</font><font class="java10">;<br />
ostream.close</font><font class="java8">()</font><font class="java10">;</font></tt></p><p>No exception is thrown. All you get is a zero-byte-sized file. I don't know about you, but this is not what I expected.</p><p>After hours of googling and searching the <a href="http://bugs.sun.com/bugdatabase/index.jsp">bug parade</a>, I found a workaround based on&nbsp;<a href="http://java.sun.com/j2se/1.5.0/docs/api/java/io/FileDescriptor.html">FileDescriptor</a>. Every FileOutputStream has an associated file descriptor. With it's sync()-method, one can force all system buffers to synchronize with the underlying device. The following code -- executed on a full disk -- raises a SyncFailedException:</p><p><tt class="java"><font class="java10">FileOutputStream ostream = </font><font class="java4">new </font><font class="java10">FileOutputStream</font><font class="java8">(</font><font class="java5">"out"</font><font class="java8">)</font><font class="java10">;<br />
ostream.write</font><font class="java8">(</font><font class="java5">"hello"</font><font class="java10">.getBytes</font><font class="java8">())</font><font class="java10">;<br />
ostream.getFD</font><font class="java8">()</font><font class="java10">.sync</font><font class="java8">()</font><font class="java10">;<br />
ostream.close</font><font class="java8">()</font><font class="java10">;</font></tt></p>
<p>I don't know the performance implications yet. But I'd rather suffer from a small performance loss than from data loss.</p>
<p>One thing, though, I have to admit: even if it makes my software look bad, bugs like <a href="http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4338871">4338871</a> on <a href="http://bugs.sun.com/bugdatabase/index.jsp">bug parade</a>&nbsp;have a certain beauty.</p>
<p>&nbsp;</p>]]></description>
	
	
	<link>http://weblog.janek.org/Archive/2004/12/20/ExceptionWhenWritingToAFu.html</link>
	<guid>http://weblog.janek.org/Archive/2004/12/20/ExceptionWhenWritingToAFu.html</guid>
	
	
	

    <pubDate>Fri, 17 Dec 2004 22:57:53 +0100</pubDate>
    
    
    <comments>http://enetation.co.uk/comments.php?user=speedball2001&amp;commentid=041217225753</comments>
    

    
  </item>

    <item>
    <title>How to print PDF documents with Java</title>
    <category>Java</category>
	<description><![CDATA[<p>I used to like Adobe. Photoshop, Postscript and PDF were great innovations. But the latest Adobe Reader 6 is a catastrophe. I'm not going to mention the application's look or it's dismal start time. No, I'm complaining about Adobe Reader's ActiveX control.</p>
<p>Adobe Reader ships with an ActiveX control. It is normally used for displaying PDF files in Internet Explorer. Since ActiveX controls are embedable, I thought I might use it to print PDF documents from Java. Embedding is easy-- just use <a href="http://www.jniwrapper.com/index.jsp">JNIWrapper</a>:</p><tt class="java"><font class="java4">public class </font><font class="java10">AcrobatReaderAutomationSample </font><font class="java4">extends </font><font class="java10">JFrame<br />
</font><font class="java8">{<br />
&nbsp;&nbsp;&nbsp; </font><font class="java4">private </font><font class="java10">OleContainer _container = </font><font class="java4">new </font><font class="java10">OleContainer</font><font class="java8">()</font><font class="java10">;<br />
&nbsp;&nbsp;&nbsp; </font><font class="java4">public </font><font class="java10">AcrobatReaderAutomationSample</font><font class="java8">()<br />
&nbsp;&nbsp;&nbsp; {<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </font><font class="java10">getContentPane</font><font class="java8">()</font><font class="java10">.add</font><font class="java8">(</font><font class="java10">_container, BorderLayout.CENTER</font><font class="java8">)</font><font class="java10">;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; _container.createObject</font><font class="java8">(</font><font class="java5">"PDF.PdfCtrl.5"</font><font class="java8">)</font><font class="java10">;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; addWindowListener</font><font class="java8">(</font><font class="java4">new </font><font class="java10">WindowAdapter</font><font class="java8">()<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </font><font class="java4">public </font><font class="java9">void </font><font class="java10">windowOpened</font><font class="java8">(</font><font class="java10">WindowEvent e</font><font class="java8">)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </font><font class="java10">_container.doVerb</font><font class="java8">(</font><font class="java10">OleVerbs.INPLACEACTIVATE</font><font class="java8">)</font><font class="java10">;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; doPrint</font><font class="java8">(</font><font class="java5">"C:\test.pdf"</font><font class="java8">)</font><font class="java10">;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </font><font class="java8">}<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </font><font class="java4">public </font><font class="java9">void </font><font class="java10">windowClosing</font><font class="java8">(</font><font class="java10">WindowEvent e</font><font class="java8">)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </font><font class="java10">_container.destroyObject</font><font class="java8">()</font><font class="java10">;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </font><font class="java8">}<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; })</font><font class="java10">;<br />
&nbsp;&nbsp;&nbsp; </font><font class="java8">}<br />
<br />
&nbsp;&nbsp;&nbsp; </font><font class="java4">private </font><font class="java9">void </font><font class="java10">doPrint</font><font class="java8">(</font><font class="java10">String filename</font><font class="java8">)<br />
&nbsp;&nbsp;&nbsp; {<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </font><font class="java10">OleMessageLoop.invokeMethod</font><font class="java8">(</font><font class="java10">this, </font><font class="java5">"printFile"</font><font class="java10">,<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </font><font class="java4">new </font><font class="java10">Object</font><font class="java8">[] { </font><font class="java10">filename </font><font class="java8">})</font><font class="java10">;<br />
&nbsp;&nbsp;&nbsp; </font><font class="java8">}<br />
<br />
&nbsp;&nbsp;&nbsp; </font><font class="java4">public </font><font class="java9">void </font><font class="java10">printFile</font><font class="java8">(</font><font class="java10">String filePath</font><font class="java8">)<br />
&nbsp;&nbsp;&nbsp; {<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </font><font class="java10">IDispatchImpl acrobatReader =<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </font><font class="java4">new </font><font class="java10">IDispatchImpl</font><font class="java8">(</font><font class="java10">_container.getOleObject</font><font class="java8">())</font><font class="java10">;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Automation automation = </font><font class="java4">new </font><font class="java10">Automation</font><font class="java8">(</font><font class="java10">acrobatReader</font><font class="java8">)</font><font class="java10">;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </font><font class="java3">// load document<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </font><font class="java10">automation.invoke</font><font class="java8">(</font><font class="java5">"LoadFile"</font><font class="java10">, </font><font class="java4">new </font><font class="java10">Object</font><font class="java8">[] { </font><font class="java10">filePath </font><font class="java8">})</font><font class="java10">;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </font><font class="java3">//print document<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </font><font class="java10">automation.invoke</font><font class="java8">(</font><font class="java5">"printWithDialog"</font><font class="java10">, </font><font class="java4">new </font><font class="java10">Object</font><font class="java8">[</font><font class="java7">0</font><font class="java8">] {})</font><font class="java10">;<br />
&nbsp;&nbsp;&nbsp; </font><font class="java8">}<br />
<br />
&nbsp;&nbsp;&nbsp; </font><font class="java4">public static </font><font class="java9">void </font><font class="java10">main</font><font class="java8">(</font><font class="java10">String</font><font class="java8">[] </font><font class="java10">args</font><font class="java8">)<br />
&nbsp;&nbsp;&nbsp; {<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </font><font class="java10">SwingUtilities.invokeLater</font><font class="java8">(</font><font class="java4">new </font><font class="java10">Runnable</font><font class="java8">()<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </font><font class="java4">public </font><font class="java9">void </font><font class="java10">run</font><font class="java8">()<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </font><font class="java3">// initialize OLE<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </font><font class="java10">OleFunctions.oleInitialize</font><font class="java8">()</font><font class="java10">;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; AcrobatReaderAutomationSample sample = <br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </font><font class="java4">new </font><font class="java10">AcrobatReaderAutomationSample</font><font class="java8">()</font><font class="java10">;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sample.setVisible</font><font class="java8">(</font><font class="java4">true</font><font class="java8">)</font><font class="java10">;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </font><font class="java8">}<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; })</font><font class="java10">;<br />
&nbsp;&nbsp;&nbsp; </font><font class="java8">}<br />
}</font></tt><p>Via the magic of OLE automation, the program opens and prints a&nbsp; file with Adobe Reader (see method printFile(...)). It actually looks like an easy thing to do. Unfortunately, the devil is in the details:</p>
<ol>
<li>The line <font face="Courier New">_container.createObject</font><font class="java8" face="Courier New">(</font><font class="java5" face="Courier New">"PDF.PdfCtrl.5"</font><font class="java8" face="Courier New">)</font><font class="java10"><font face="Courier New">;</font>
works only with Adobe Reader 5. Sometimes, but I can't exactly say when, it also works with Adobe Reader 6. But in order to be sure, you have to call &nbsp;<font face="Courier New">_container.createObject</font><font class="java8" face="Courier New">(</font><font class="java5" face="Courier New">"PDF.PdfCtrl.6"</font><font class="java8" face="Courier New">)</font> as well. In versions 5 and 6, the control understands the same messages. Why Adobe chose to name the controls differently, I don't know.</font>
</li>
<li>When the document contains more than one page, the print dialog automatically selects the Option "Print Pages 1 to 1". There exists the option "Print All", but there's no way to select it via OLE. The user has to do it manually. Urgh.
</li>
<li><p>Theoretically, one could circumvent the above by using the method "printPages(from, to)". With Adobe Reader 5 it works as advertised: it prints the selected pages without showing the print dialog. With Adobe Reader 6, though, the control displays a warning "Attention: some script wants to print a document. It might print the whole document." (I'm paraphrasing, as I only know the German message).</p>
What the ...? I mean, if you don't want some external process to do something with you, don't expose the method.
</li>
<li>Since Reader 6 is such a moloch, Adobe changed the semantics of object release. With OLE objects, you have to do explicit reference management: if you acquire an object reference then you also have to release it. With Adobe Reader 5, the acrord32.exe disappeared from the process list after the object reference was released. Now, it doesn't. Reader 6 uses about 35MB and the only ways to close it are to kill it or open the Adobe Reader program and close that. That takes care of the acrord32.exe instance.
</li>
</ol>
<p><font class="java10">That's it from the top of my head. I fought a week trying to force my will upon Adobe Reader 6.</font> <font class="java10">I'm at a point,were I hate that software with passion.</font></p>
<p>Summary: What looked like the perfect solution to printing with Java under Windows, turned into a week-long debug fest with questionable results. Adobe Reader 5 worked flawlessly. My main gripe is version 6. It is completely screwed up.</p>]]></description>
	
	
	<link>http://weblog.janek.org/Archive/2004/10/26/HowtoprintPDFdocumentswit.html</link>
	<guid>http://weblog.janek.org/Archive/2004/10/26/HowtoprintPDFdocumentswit.html</guid>
	
	
	

    <pubDate>Tue, 26 Oct 2004 15:02:54 +0100</pubDate>
    
    
    <comments>http://enetation.co.uk/comments.php?user=speedball2001&amp;commentid=041026150254</comments>
    

    
  </item>

    <item>
    <title>Avoid InstallAnywhere At All Cost</title>
    <category>Java</category>
	<description><![CDATA[<p><strong>Update (14.12.2007):</strong> Please see my comments <a href="#update">below</a>.</p>
<p>The nice <a href="http://keyboardsamurais.de/node/view/63">article</a> about the deployment of client-side Java applications by <a href="http://keyboardsamurais.de/">Keyboardsamurais</a> reminds me that I wanted to warn of ZeroG's InstallAnywhere.</p>
<p>On paper, InstallAnywhere looks like the perfect solution for all your installation needs; but if you look closer it's full of bugs -- from small and subtle to downright embarrassing.</p>
<p>
The feature list:</p>
<ul>
<li>Extensive platform support. It runs on all major platforms, including Linux, Windows and Mac OS X
</li>
<li>GUI designer
</li>
<li>Localizations available for 29 languages
</li>
<li>Platform integration: installers create aliases, shortcuts, and links, execute platform-specific executables, install to system-specific locations (such as the Windows Start Menu or the Mac OS X Dock), register OS-dependent libraries,&nbsp;<!--StartFragment --> manage Windows Services and read/write from the registry.
</li>
<li>LaunchAnywhere: native launcher for applications on all platforms
</li>
<li>Automatic Java VM installation
</li>
<li>And <a href="http://www.installanywhere.com/products_ia_07a.shtml">more</a>
</li>
</ul>
<p>Let's start with the file format and parser -- one of the embarrassing bugs. Up to InstallAnywhere 5, InstallAnywhere projects&nbsp;&nbsp;were renamed Java class files. With version 5, they decided to store the project information in XML. It was promoted as the ideal solution for hand editing, XSL transformations etc. But while the format is XML it is still a meaningless externalization of InstallAnywhere's internal object representation. The structure is undocumented and unreadable. But you'll learn that they use java.util.Vector a lot.</p>
<p>The file parser is a complete nightmare. Some genius decided to write the XML parser inhouse. He must have been under the impression that all the complete, fast and correctly implemented parsers out there aren't good enough. The result? You're in trouble if you use XSLT to make changes to the project file. For instance,&nbsp; it is valid to have more than one CDATA section:</p><pre>
&lt;tag&gt;&lt;![CDATA[Two]]&gt;&lt;![CDATA[cdata sections]]&gt;&lt;/tag&gt;
</pre>
<p>
InstallAnywhere's XML parser can't process that. It may look stupid, but it's coming out of XSLT processors. That means you not only execute a simple XSL transformation; you must perform complex text transformations with sed or Ant as well. </p>
<p>On Windows, InstallAnywhere can register services. Of course, it only covers the basics -- registration of the program, start mode and a description. More complex things, such as dependencies, are not implemented. So if you're service depends on another service your out of luck. Unless you read the stuff up and write the needed registry keys yourself.</p>
<p>It's the same with the uninstaller. InstallAnywhere can create an uninstaller and register it with the Software applet in the Control Panel. The applet supports individual icons for uninstallers. But with InstallAnywhere it displays a generic, ugly icon. Either you accept it or set the registry key by hand.</p>
<p>Sorry, but that's exactly the kind of know-how that I don't want to have.</p>
<p>Installer localization is another pet peeve. The quality of the translations is good. Also, you can customize them in the designer. But only for English. If you need to customize another language you have to edit a property file. As all of our installers are currently in German, we edit that file a lot. To make matters worse, InstallAnywhere likes to overwrite that file from time to time.</p>
<p>What really upsets me is that the localization file contains more than just language. An example: you can create new text files from the installer. We use it to create configuration files. The content of those files is also stored in the localization file. It took me a couple of days to figure that out. I was changing something in the designer, but the installer never executed it. It turned out that if you change the file's content in the designer, it only changed the English localization file.</p>
<p>I could go on and on. Work with InstallAnywhere has never been pleasant but often surprising. If your in the market for a cross-platform installer shop around. If you think, InstallAnywhere suits your needs, download the evaluation copy. It's unrestricted in functionality. Don't buy before you completely implemented the installer and are ready to ship.</p>
<p>The experiences above were made with InstallAnywhere Enterprise Edition 5.0.7. We never updated to version 6. It's too much hassle for way too much money.</p>
<p><em>My friends <a href="http://www.michael-hauf.com">Michael Hauf</a> and Daniel Schulz contributed to this post.</em></p>
<p><a id="update" name="update"></a>
<strong>Update (14.12.2007):</strong> I got contacted by a representative of Macrovision, InstallAnywhere's 
producer. He assured me that the current version, InstallAnywhere 2008, has improved a lot. Unfortunately, I don't have the time to review the new version. I suggest you <a href="http://www.macrovision.com/products/installation/installanywhere.htm">download</a> the evaluation copy and try for yourself.</p>
<p>When we bought InstallAnywhere 3 years ago, we thought we had to support lots of platforms but then only shipped on Windows and Linux. Today, we use <a href="http://nsis.sourceforge.net">NSIS</a> on Windows, which is a great open source script-based installer. Our Linux users are either sophisticated or have administrators: We send them tar files. In case you need to support more than those two platforms: I've heard good things about <a href="http://www.ej-technologies.com/products/install4j/overview.html">install4j</a> although I haven't used it so I don't know if it's true.</p>
<p>In any event, I still stand by my suggestion made in 2004: Regardless of the installer you'll choose, implement it completely using the evaluation version and don't buy before you're ready to ship.</p>]]></description>
	
	
	<link>http://weblog.janek.org/Archive/2004/09/23/AvoidInstallAnywhereAtAll.html</link>
	<guid>http://weblog.janek.org/Archive/2004/09/23/AvoidInstallAnywhereAtAll.html</guid>
	
	
	

    <pubDate>Thu, 23 Sep 2004 22:44:05 +0100</pubDate>
    
    
    <comments>http://enetation.co.uk/comments.php?user=speedball2001&amp;commentid=040923224405</comments>
    

    
  </item>

    <item>
    <title>A Couple Of Desktop Java Links</title>
    <category>Java</category>
	<description><![CDATA[<p><a href="http://freshmeat.net/releases/173669/">JRex 1.0b_html2</a>&nbsp;-- JRex is an API for integrating Mozilla with Swing. A lot of enhancements, including DOM HTML2 and Webstart.</p>
<p><a href="http://blogs.sun.com/roller/page/ColmSmyth/20040910">Java and Desktop/Platform Integration</a> -- Blog that lists APIs and possible use cases for desktop integration that go beyond what J2SE offers.</p>
<p><a href="https://xhtmlrenderer.dev.java.net/">Flying Saucer: The 100% Java XHTML Renderer</a>&nbsp;-- Beta 3 was published a couple of days ago. Check out the impressing Webstart <a href="https://xhtmlrenderer.dev.java.net/dist/fs.jnlp">demo</a>. You don't expect that from a Java desktop application.</p>
<p>Via <a href="http://freshmeat.net/">freshmeat.net</a> and <a href="http://community.java.net/javadesktop/">JavaDesktop</a>.</p>]]></description>
	
	
	<link>http://weblog.janek.org/Archive/2004/09/23/ACoupleofDesktopJavaLinks.html</link>
	<guid>http://weblog.janek.org/Archive/2004/09/23/ACoupleofDesktopJavaLinks.html</guid>
	
	
	

    <pubDate>Thu, 23 Sep 2004 22:06:29 +0100</pubDate>
    
    
    <comments>http://enetation.co.uk/comments.php?user=speedball2001&amp;commentid=040923220629</comments>
    

    
  </item>

    <item>
    <title>Re: a JList feature</title>
    <category>Java</category>
	<description><![CDATA[<p>Diego &nbsp;<a href="http://www.dynamicobjects.com/d2r/archives/002861.html">found</a> a feature (a bug?) in Swing's JList: it processes keystrokes to assist with keyboard navigation. As I discovered, JComboBox behaves similarly.&nbsp;</p>
<p>Keyboard navigation in itself is not bad; it's Diego's unique setting that makes it problematic. First, he seemed to have a huge list of entries and hitting a key pulls thousands of objects from the database. Second, that happened when he hit the Del key. The implementation of JList is obviously not optimal:</p>
<ul>
<li>It does not filter non-printable characters.
</li>
<li>It's difficult to customize: The KeyListener of JList's UI implementation is created in a private method and calls back into JList's getNextMatch(String prefix, int startIndex, Position.Bias bias).
</li>
</ul>
<p>The mechanism in JComboBox is cleaner: for keyboard navigation one supplies a JComboBox.KeySelectionManager, which hides the navigation logic (the default implementation evaluates only one keystroke).</p>
<p>That JList and JComboBox implement the same feature using different mechanisms is a bit puzzling. Especially if you know that JComboBox uses a JList internally. One thing is scary, though. The JList instance used inside JComboBox's UI delegate still has the it's own KeyListener for navigation. The only way to remove it, is to inherit from BasicComboBoxUI, overwrite createList() and use Diego's trick.</p>

<p>I still find that keyboard navigation is a feature not a bug. Diego complains that this functionality is too dependent of the storage mechanism. In my opinion independence of the storage mechanism is provides by the means of ListModel. Combine that with JComboBox's KeySelectionManager and you have a pretty generic and easily customizable solution. JList's implementation is stupid, I agree with that.</p>]]></description>
	
	
	<link>http://weblog.janek.org/Archive/2004/07/13/ReaJListfeature.html</link>
	<guid>http://weblog.janek.org/Archive/2004/07/13/ReaJListfeature.html</guid>
	
	
	

    <pubDate>Sun, 11 Jul 2004 21:15:11 +0100</pubDate>
    
    
    <comments>http://enetation.co.uk/comments.php?user=speedball2001&amp;commentid=040711211511</comments>
    

    
  </item>

    <item>
    <title>JNIWrapper - Java Desktop Integration Done Right</title>
    <category>Java</category>
	<description><![CDATA[<p>Here's my recommendation for <a href="http://www.sun.com">SUN</a>: dump <a href="https://jdic.dev.java.net/">JDIC</a> and buy these <a href="https://www.jniwrapper.com">guys</a>. Their JNIWrapper is an amazing product. I've already <a href="../../Archive/2004/06/19/BetterDesktopJavaWiki.html">blogged</a> about it.</p><p>At the core, the JNIWrapper simplifies accessing native code. This is done via a dynamic invocation interface. It is well designed and easy to use:</p><p>
<tt class="java"><font class="java4">public class </font><font class="java10">ShellExecute </font><font class="java8">{<br />
&nbsp; </font><font class="java4">private static final </font><font class="java10">FunctionName SHELL_EXECUTE =<br />
&nbsp;&nbsp;&nbsp; </font><font class="java4">new </font><font class="java10">FunctionName</font><font class="java8">(</font><font class="java5">"ShellExecute"</font><font class="java8">)</font><font class="java10">;<br />

<br />
&nbsp; </font><font class="java4">public static </font><font class="java9">boolean </font><font class="java10">execute</font><font class="java8">(</font><font class="java10">String file</font><font class="java8">) {<br />
&nbsp;&nbsp;&nbsp; </font><font class="java10">Function shellExecute =<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Shell32.getInstance</font><font class="java8">()</font><font class="java10">.getFunction</font><font class="java8">(</font><font class="java10">SHELL_EXECUTE.toString</font><font class="java8">())</font><font class="java10">;<br />

&nbsp;&nbsp;&nbsp; Int32 ret = </font><font class="java4">new </font><font class="java10">Int32</font><font class="java8">()</font><font class="java10">;<br />
&nbsp;&nbsp;&nbsp; shellExecute.invoke</font><font class="java8">(</font><font class="java10">ret, </font><font class="java3">// return value<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </font><font class="java4">new </font><font class="java10">Parameter</font><font class="java8">[] {<br />

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </font><font class="java4">new </font><font class="java10">Handle</font><font class="java8">()</font><font class="java10">, </font><font class="java3">// hWnd<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </font><font class="java4">new </font><font class="java10">Str</font><font class="java8">(</font><font class="java5">"open"</font><font class="java8">)</font><font class="java10">, </font><font class="java3">// lpOperation<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </font><font class="java4">new </font><font class="java10">Str</font><font class="java8">(</font><font class="java10">file</font><font class="java8">)</font><font class="java10">, </font><font class="java3">// lpFile<br />

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </font><font class="java4">new </font><font class="java10">Str</font><font class="java8">()</font><font class="java10">, </font><font class="java3">// lpParameters<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </font><font class="java4">new </font><font class="java10">Str</font><font class="java8">()</font><font class="java10">, </font><font class="java3">// lpDirectory<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </font><font class="java4">new </font><font class="java10">Int32</font><font class="java8">(</font><font class="java7">1</font><font class="java8">)&nbsp; </font><font class="java3">// nShowCmd<br />

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </font><font class="java8">})</font><font class="java10">;<br />
&nbsp;&nbsp;&nbsp; </font><font class="java4">if</font><font class="java8">(</font><font class="java10">ret.getValue</font><font class="java8">() </font><font class="java10">&lt;= </font><font class="java7">32</font><font class="java8">) {<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </font><font class="java10">System.err.println</font><font class="java8">(</font><font class="java5">"could not execute ShellExecute: " </font><font class="java10">+<br />

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; file + </font><font class="java5">". Return: " </font><font class="java10">+ ret.getValue</font><font class="java8">())</font><font class="java10">;<br />
&nbsp;&nbsp;&nbsp; </font><font class="java8">}<br />
&nbsp;&nbsp;&nbsp; </font><font class="java4">return </font><font class="java8">(</font><font class="java10">ret.getValue</font><font class="java8">() </font><font class="java10">&gt; </font><font class="java7">32</font><font class="java8">)</font><font class="java10">;<br />

&nbsp; </font><font class="java8">}<br />
&nbsp; <br />
&nbsp; </font><font class="java4">public static </font><font class="java9">void </font><font class="java10">main</font><font class="java8">(</font><font class="java10">String</font><font class="java8">[] </font><font class="java10">args</font><font class="java8">) {<br />
&nbsp;&nbsp;&nbsp; </font><font class="java10">ShellExecute.execute</font><font class="java8">(</font><font class="java5">"http://weblog.janek.org"</font><font class="java8">)</font><font class="java10">;<br />

&nbsp; </font><font class="java8">}<br />
}</font></tt>
</p><p>The code uses Window's <a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/shell/reference/functions/shellexecute.asp">ShellExecute</a>&nbsp;function to open my weblog in the Windows standard browser.</p>
<p>On top of JNIWrapper, they implemented <a href="http://www.jniwrapper.com/winpack.jsp">WinPack</a>. Just as examples, here's what can be done with it. In my applications, I use it to</p>
<ul>
<li>embed Adobe Reader and Flash Player using COM automation,
</li>
<li>provide a Trayicon,
</li>
<li>open URLs in the standard browser (see above), and
</li>
<li>respect internet settings, such as http proxy and automatic dial-up.
</li>
</ul>
<p>JNIWrapper's latest project, <a href="http://www.jniwrapper.com/jexplorer.jsp">JExplorer</a>, provides a Java API for embedding Internet Explorer. It closely resembles the<a href="http://msdn.microsoft.com/workshop/browser/webbrowser/browser_control_node_entry.asp">WebBrowser</a> control API. Integration with Mozilla is on the way.</p>
<p>Their support is exceptional. Wenn JNIWrapper 2.4 came out, I discovered a bug on Windows 98. It was fixed in less than an hour. And when you look at their prices, you'll find that the product is downright cheap. A Linux version of JNIWrapper is available as well.</p>]]></description>
	
	
	<link>http://weblog.janek.org/Archive/2004/06/27/JNIWrapper-JavaDesktopInt.html</link>
	<guid>http://weblog.janek.org/Archive/2004/06/27/JNIWrapper-JavaDesktopInt.html</guid>
	
	
	

    <pubDate>Sun, 27 Jun 2004 23:58:32 +0100</pubDate>
    
    
    <comments>http://enetation.co.uk/comments.php?user=speedball2001&amp;commentid=040627235832</comments>
    

    
  </item>

    <item>
    <title>Can this possibly be efficient?</title>
    <category>Java</category>
	<description><![CDATA[<p>Ok, I might be controversial, but <a href="http://jroller.com/page/rickard/20040620">this</a> has to be inefficient. Because he chose to persist serialized objects, <a href="http://jroller.com/page/rickard">Rickard</a>&nbsp;used <a href="http://xstream.codehaus.org/">XStreams</a> and XSLT to carry out a database schema migration. <a href="http://jroller.com/page/olegp/20040625#schema_migration_a_beautiful_idea">Oleg</a> even calls it beautiful. Maybe it's just me, but I feel this is a problem not a solution.&nbsp; But then, I'm a client-side kinda guy. What do I know?</p><p>Rickard, if you happen to read that, could you post the size of the database, memory requirements and execution time of the conversion? Just curious.</p>]]></description>
	
	
	<link>http://weblog.janek.org/Archive/2004/06/25/Canthatpossiblyefficicien.html</link>
	<guid>http://weblog.janek.org/Archive/2004/06/25/Canthatpossiblyefficicien.html</guid>
	
	
	

    <pubDate>Fri, 25 Jun 2004 23:49:08 +0100</pubDate>
    
    
    <comments>http://enetation.co.uk/comments.php?user=speedball2001&amp;commentid=040625234908</comments>
    

    
  </item>

    <item>
    <title>InfoBus - An API for event-driven Swing programming</title>
    <category>Java</category>
	<description><![CDATA[<p><a href="http://weblogs.java.net/pub/au/95">David</a> has an interesting article on event-driven GUI programming. He describes two patterns, but usually it comes down this:</p>
<blockquote>The user issues a long-running command and the GUI sends it to the command queue. Other threads receive the command from the queue, compute the result and update the GUI through calls to SwingUtilities.invokeLater().
</blockquote>
<p>So far so good. For me, the surprising part is his choice for a message bus. David uses <a href="http://somnifugi.sourceforge.net/">Somnifugi</a>, a single-JVM JMS implementation. The obvious choice for me has always been the standard extension API <a href="http://java.sun.com/products/archive/javabeans/infobus/spec12/IB12Spec.htm">InfoBus</a>. Despite it's relative obscureness, it's the best tool for event-driven programming inside a JVM that I know.</p>

<p>Of course, with InfoBus producers produce data items and consumers process them. But there are APIs that make InfoBus special:</p>
<dl>
<dt>Producers can revoke data items.
</dt>
<dd>Great when the data becomes invalid.&nbsp;
</dd>
<dt>Consumers can act.
</dt>
<dd> That means, instead of only waiting for event arrival they can request a data item.
This can prevent race conditions when the consumer is constructed later than the producer and misses the initial event.
</dd>
<dt>An InfoBus can be guarded.
</dt>
<dd>Whenever a data item is published the a guard can decide what to do with it.
This could be used, for instance, to enforce execution order.
</dd>
</dl>
<p>All in all, it is a complete API for loosly-coupled component interaction in a one JVM. I believe stock JMS does not address all of it. But then, I might have missed something when skimming over the specification.</p>]]></description>
	
	
	<link>http://weblog.janek.org/Archive/2004/06/23/InfoBus-AnAPIforevent-dri.html</link>
	<guid>http://weblog.janek.org/Archive/2004/06/23/InfoBus-AnAPIforevent-dri.html</guid>
	
	
	

    <pubDate>Wed, 23 Jun 2004 22:50:27 +0100</pubDate>
    
    
    <comments>http://enetation.co.uk/comments.php?user=speedball2001&amp;commentid=040623225027</comments>
    

    
  </item>

    <item>
    <title>Better Desktop Java Wiki</title>
    <category>Java</category>
	<description><![CDATA[<p>I enhanced several categories in the new <a href="http://wiki.java.net/bin/view/Main/BetterDesktopJava">BetterDesktopJava-Wiki</a> on <a href="http://www.java.net">java.net</a>. Among the entries are:</p>
<ul>
<li><a href="http://roxes.de/produkte/rat.html" target="_top">Roxes Ant tasks</a>, which provide several <a href="http://ant.apache.org">ANT</a> tasks that can create native executables for Windows, MacOS and several Unixes, read and write registry keys, create shortcuts on Windows and KDE and much more.
</li>
<li><a href="http://www.jniwrapper.com" target="_top">JNIWrapper</a> your one-stop-solution to desktop integration on Windows. It makes writing JNI code for Win32 very easy. JNIWrapper ships with the <a href="http://www.jniwrapper.com/winpack.jsp">WinPack</a> library, which allows the programmer to
</li>
<li style="LIST-STYLE-TYPE: none">
<ul>
<li>open native dialogs (color, file and folder chooser),
</li>
<li>create transparent, custom-shaped native windows,
</li>
<li>read and write the registry,
</li>
<li>access shell functionality (systray, shell folders, system colors and symbolic links),
</li>
<li>access system services and
</li>
<li>embed OLE components, such as Adobe Reader, Internet Explorer, Flash player and MS Office applications.
</li>
</ul>
</li>
<li>Kai Toedter's <a href="http://toedter.com/en/jcalendar/index.html">JCalendar</a> calendar beans
</li>
<li><a href="http://www.iconexperience.com/index.php">IconExperience</a> a repository of great looking, consistent, reasonably priced icons
</li>
</ul>

<p>I also learned about several new Swing components in the components <a href="http://wiki.java.net/bin/view/Main/SwingComponents">category</a>. Some of them look pretty decent.</p>]]></description>
	
	
	<link>http://weblog.janek.org/Archive/2004/06/19/BetterDesktopJavaWiki.html</link>
	<guid>http://weblog.janek.org/Archive/2004/06/19/BetterDesktopJavaWiki.html</guid>
	
	
	

    <pubDate>Sun, 20 Jun 2004 00:00:33 +0100</pubDate>
    
    
    <comments>http://enetation.co.uk/comments.php?user=speedball2001&amp;commentid=040620000033</comments>
    

    
  </item>

    <item>
    <title>Flying Saucer - Pure Java XHTML renderer</title>
    <category>Java</category>
	<description><![CDATA[<p><a href="http://weblogs.java.net/pub/au/79">Joshua Marinacci</a> did it again. After an extensive study covering almost every Java-based webbrowser available (both, <a href="http://today.java.net/pub/a/today/2004/05/24/html-pt1.html">open-source</a> and <a href="http://today.java.net/pub/a/today/2004/06/14/html-pt2.html">commercial</a>), he launched a new project:<a href="http://weblogs.java.net/pub/wlg/1444">Flying saucer</a> - a pure Java XHTML renderer.</p>
<p>Since it is obvious that a single person can't develop a web browser by himself, he made an intelligent decision: cut the crap. Flying saucer won't be a browser. No bookmarks, history, javascript. It will support XHTML and CSS only. He reasons: "Since this is for embedding in my own programs most of the content will be generated by my own code. I don't need to deal with every browser bug and every malformed webpage out there. I could get by with strictly compliant pages and worry about quirks handling in a compatibility library.".</p>
<p>A prototype is available.</p>]]></description>
	
	
	<link>http://weblog.janek.org/Archive/2004/06/18/FlyingSaucer-PureJavaXHTM.html</link>
	<guid>http://weblog.janek.org/Archive/2004/06/18/FlyingSaucer-PureJavaXHTM.html</guid>
	
	
	

    <pubDate>Fri, 18 Jun 2004 23:07:23 +0100</pubDate>
    
    
    <comments>http://enetation.co.uk/comments.php?user=speedball2001&amp;commentid=040618230723</comments>
    

    
  </item>

    <item>
    <title>Tray API for JDIC</title>
    <category>Java</category>
	<description><![CDATA[<p>Via <a href="http://www.thauvin.net/linkblog/?date=2004-06-15#4457">Erik</a>,
via <a href="http://cld.blog-city.com/read/653124.htm">Charles</a>: 
<a href="https://jdic.dev.java.net/">JDIC</a> gets a tray icon 
<a href="https://jdic.dev.java.net/documentation/incubator/tray/index.html">api</a>.</p>]]></description>
	
	
	<link>http://weblog.janek.org/Archive/2004/06/15/TrayAPIforJDIC.html</link>
	<guid>http://weblog.janek.org/Archive/2004/06/15/TrayAPIforJDIC.html</guid>
	
	
	

    <pubDate>Tue, 15 Jun 2004 22:20:17 +0100</pubDate>
    
    
    <comments>http://enetation.co.uk/comments.php?user=speedball2001&amp;commentid=040615222017</comments>
    

    
  </item>

    <item>
    <title>Re: JDIC criticism misses the big picture</title>
    <category>Java</category>
	<description><![CDATA[<p><a href="http://shemnon.com/speling/">Danno</a> has a weblog where he publishes a lot of good articles about Desktop Java. His latest post <a href="http://shemnon.com/speling/archives/000158.html">"JDIC criticism misses the big picture"</a>, well, misses the point. While his criticism of Jonathan Simon's <a href="http://weblogs.java.net/pub/wlg/1388">rant</a> about the new Java Desktop Integration Components (JDIC) is completely on target, his tongue-in-cheek comments about JDIC's features aren't. Here is my take on them.</p>
<p>About JDIC's web browser control he writes</p><blockquote><p>The reference implementation uses Mozilla, but why use HTML when you've gone tot he trouble to write a Java GUI? Oh yea... Ads.</p></blockquote>
<p>I maintain an application for exchanging business documents, such as orders or invoices. It is a desktop application with the classical three-pane layout. For document viewing, I transform the documents to HTML and display them. And that's where pure Java sucks. Three years ago, when development started, I had the following options: JEditorPane, <a href="http://www.icesoft.com/">IceBrowser</a> and <a href="http://www.netcluesoft.com/">NetClue</a>. JEditorPane is horrible and IceBrowser prohibitively expensive. So I settled on NetClue. NetClue has it's own issues and, as it seems, has turned into abandon-ware. It has not been updated in years; emails aren't answered. At this point, JDIC's web browser is a great alternative. While it's not pure Java, it's cross-platform enough for my taste.</p>
<p>JDIC has APIs to associate programs with file types. Danno's comment</p><blockquote><p>Just what Java needs, more "JNN is not registered as the default News Reader, would you like to register it now?" dialogs.</p></blockquote>
<p>is funny. But then, noone forces you to misuse the API. I don't think that associating an application with it's file type during install time is a bad thing. I could see JasperAssistant use this API to associate itself with *.jasper files.</p>
<p>JDIC ships with a tool for putting JNLP applications into installable packages. Danno:</p><blockquote><p>Clicking on a link in the platform native web browser must still be to hard, wizards are much easier.</p></blockquote>
<p>Yes it is. I have users, who are pretty computer-illiterate. Sometimes they don't even know how to move a window. No kidding. For installation, we couldn't point them to a URL and tell them to click that link. The webstart method of installing software is not going to cut it. They don't have Java installed. It wouldn't work for updates either. Some of the users are, for whatever reason, unable to download updates from the web site. I actually have to ship the CD and tell them to shove it in the CD-ROM and push the "Next" button until the update program is finished. I don't know why, but they manage to do that. The wizard interface works wonder, it seems.</p>
<p>Danno comments:</p>
<blockquote><p>They are also looking at adding screen savers.</p></blockquote>
<p>This is silly, indeed.</p>]]></description>
	
	
	<link>http://weblog.janek.org/Archive/2004/06/14/ReJDICcriticismmissestheb.html</link>
	<guid>http://weblog.janek.org/Archive/2004/06/14/ReJDICcriticismmissestheb.html</guid>
	
	
	

    <pubDate>Mon, 14 Jun 2004 22:14:51 +0100</pubDate>
    
    
    <comments>http://enetation.co.uk/comments.php?user=speedball2001&amp;commentid=040614221451</comments>
    

    
  </item>

    <item>
    <title>Named Parameters in Java</title>
    <category>Java</category>
	<description><![CDATA[<p><a href="http://twasink.net/blog/archives/2004/06/a_feature_that.html">Robert</a> likes named parameters. With named parameters, you could code like this</p><blockquote dir="ltr" style="MARGIN-RIGHT: 0px">
<p>map.put(key:foo.getId(), value:foo);</p>
</blockquote>
<p>or this</p><blockquote dir="ltr" style="MARGIN-RIGHT: 0px">
<p>map.put(value:foo, key:foo.getId());</p>
</blockquote><p>It's something that's been available in Python. I have to admit that named parameters have charm. But while I like Python, I don't use named parameters. I'm with <a href="http://www.beust.com/weblog/archives/000096.html">Cedric</a> on this one. Named parameters become part of a methods signature. This is bad because a name change of a single parameter breaks compatibility. Besides, there are alternatives that don't require changing the language.</p>
<p>Read the discussion over at <a href="http://www.beust.com/weblog/archives/000096.html">Cedric's</a> to get the full dose.</p>]]></description>
	
	
	<link>http://weblog.janek.org/Archive/2004/06/10/NamedParametersinJava.html</link>
	<guid>http://weblog.janek.org/Archive/2004/06/10/NamedParametersinJava.html</guid>
	
	
	

    <pubDate>Thu, 10 Jun 2004 23:08:57 +0100</pubDate>
    
    
    <comments>http://enetation.co.uk/comments.php?user=speedball2001&amp;commentid=040610230857</comments>
    

    
  </item>

    <item>
    <title>Desktop Integration for Java Applications</title>
    <category>Java</category>
	<description><![CDATA[<p>SUN finally realized that in order to survive on the desktop, Java needs to integrate better with the underlying platform. Now that desktops, web browsers or email programs have become ubiquitous, access to those components in a portable way is possible. Today, SUN released <a href="https://jdic.dev.java.net/index.html">JDIC</a>, the JDesktop Integration Components. They allow Java applications to
</p>
<ul>
<li>embed a HTML renderer,
</li>
<li>send an email through the standard mailer,
</li>
<li>open and print documents using their associated standard application, and
</li>
<li>open a URL in the standard browser.
</li>
</ul>
<p>It's about time!</p>]]></description>
	
	
	<link>http://weblog.janek.org/Archive/2004/06/01/DesktopIntegrationforJava.html</link>
	<guid>http://weblog.janek.org/Archive/2004/06/01/DesktopIntegrationforJava.html</guid>
	
	
	

    <pubDate>Wed, 02 Jun 2004 01:22:58 +0100</pubDate>
    
    
    <comments>http://enetation.co.uk/comments.php?user=speedball2001&amp;commentid=040602012258</comments>
    

    
  </item>

    <item>
    <title>JRex - Embedding Mozilla in Java</title>
    <category>Java</category>
	<description><![CDATA[<p>Everybody knows: HTML rendering with Java is a nightmare. I've been looking for a decent HTML renderer for almost four years. Back then, <a href="http://xbrowser.sourceforge.net/">XBrowser</a> showed potential. Development seems to have stopped, though, leaving it at HTML 3.2 level.</p>
<p>In his <a href="http://today.java.net/pub/a/today/2004/05/24/html-pt1.html">article</a> on <a href="http://www.java.net/">java.net</a>, Joshua Marinacci tests a couple of open source HTML renderers. The situation seems to be as it was four years ago: the pure Java renders can handle only simple pages.</p>
<p><a href="http://jrex.mozdev.org/">JRex</a>, on the other hand, handles almost any webpage as it embeds <a href="http://www.mozilla.org/products/mozilla1.x/">Mozilla</a>. Check out the screenshot:</p><div class="centeredImg"><a href="../../Archive/2004/05/27/jrex_tab_ctct.JPG"><img height="145" alt="Screenshot of JRex" src="../../Archive/2004/05/27/jrex_tab_ctct_small.JPG" width="200" border="0" /></a></div><p>While this solution is not Pure Java, it's crossplatform enough for my taste. I'm sure, customers don't mind either.</p>]]></description>
	
	
	<link>http://weblog.janek.org/Archive/2004/05/27/JRex-EmbeddingMozillainJa.html</link>
	<guid>http://weblog.janek.org/Archive/2004/05/27/JRex-EmbeddingMozillainJa.html</guid>
	
	
	

    <pubDate>Thu, 27 May 2004 22:00:45 +0100</pubDate>
    
    
    <comments>http://enetation.co.uk/comments.php?user=speedball2001&amp;commentid=040527220045</comments>
    

    
  </item>

        
    </channel>
</rss>