Archive for December, 2005

Dec 21 2005

JTree Drag and Drop Gotcha

Published by under Old Restored

Before adding Drag and Drop capabilities to my JTable, I read Java Tip 97 and Java Tip 114 from JavaWorld. They were fairly helpful, but I ended up doing things a little differently. In implementing my Drag and Drop JTree, however, I was plagued by a persistent exception: “InvalidDnDOperationException: Drag and drop in progress.” I debugged my code for hours before finally finding the source of the error. Somewhere along the line I had called tree.setDragEnabled( true ), which is what caused the error. You will always get this error if you call setDragEnabled ( true ) while also creating a DragSource using your JTree. My completed Drag and Drop enabled JTree can be found here if anyone is interested in using it. It contains a lot of other methods related to my specific project that you’ll have to wade through and remove. But if you focus on the Drag and Drop related methods, you’ll get the gist of how it’s done.

2 responses so far

Dec 12 2005

Java News-reader Application

Published by under Old Restored

I started working on a news aggregator application as my semester project last month, but it has turned into much more than the simple RSS reader is started out as. It now reads all versions of RSS, RDF and Atom. I’ve also updated the GUI to have a nicer look and feel. Here’s are some screen captures.
Jreader 1JReader 2JReader 3

There’s still some work to be done before ComputerFest contest in February, but it’s coming along nicely. I’ll be offering it for beta testing when I get all of the minimum features added. If you’re interested, check back in the next week or so and I should have something posted for download.

3 responses so far

Dec 01 2005

The RSS Version Fiasco

Published by under Old Restored

I’ve recently been extending my Java RSS/Atom feed reader to support more versions of RSS. In doing so I’ve discovered that the version history of RSS is a lot more complicated than I’d thought. One would assume that the version history was linear from 0.9 through 2.0, but one would be wrong. Versions 0.9, 0.91, 0.92, and 0.93 all follow the same branch, but version 1.0 forks from this branch to form it’s own specification that uses the rdf namespace. And adding to the confusion, version 2.0 is a continuation of 0.93. (Here’s a good article with links to information about the history of RSS, the fork, and the Atom format.) As someone with no knowledge of this fork, I’ve looked through scores of RSS feeds, trying to reconcile the obvious differences in version formats. When I read about the fork, it finally made sense. Whew. But man, what a pain in the butt. I now have to write SAX parsers that read and validate all of these differeng standards. I guess it’s better than wriing an HTML parser!  

No responses yet