Open Source II: Electric Boogaloo (CalendarPopup)

There aren't nearly as many calendar controls out there for client-side Java as you might think. Lots for DHTML/Javascript/whatever, but not too many for Swing. Tonight, I release CalendarPopup, a control for Swing that is used similarly to a JFormattedTextField, but looks like this:

CalendarPopup Example

That makes two personal Java itches scratched, two projects released in two days, and another 415 SLOC donated to the open-source community. » read more

Open Source Release: FormLayout

It's always bugged me how hard Java Swing makes it to so a simple one-column form like:

Name
Address

My open-source release of the FormLayout Layout Manager for Java fixes that.

Extending Java's TreeMap to Sort Keys by Their Associated Value

Something that's bugged me for a while is how Java's TreeMap (a VERY useful JCF class) sorts only by key. Sure, you could reverse the map and just put values in there, but what if you have more than one key with the same value? Since the keys must be unique, you lose data if you just put() to the same place over and over. Plus, it might be nice to sort those keys by key as well as value.

There's a "bi-directional" TreeMap in the Apache commons, but that doesn't do it for me either. Values must now be unique, which does me no good. What I want is a TreeMap that:

  1. Sorts the keys first by value, then

Implementing a "Wizard" in PHP Using the MVC Pattern

I've written a lot of PHP-driven websites over the last few years, mostly because PHP is so good for rapid web development. Sure, I've used ASP, JSP, and tons of other technologies, but when I needed to rewrite my resume database (yep, I don't have a resume, I have a resume database), PHP was the first on the short list due to its impressive speed of development.

The problem, however, is that PHP (like Perl) can quickly become write-only code if you let it. I'd like to have some hope of actually maintaining this site as time goes on, so I decided to implement the site based loosely on the Model-View-Controller (MVC) design pattern. This is probably overkill, but it works great when the site will be asking the user a lot of questions like mine does. The point here was to write a site that will ask a variable number of delivery and formatting questions and finally spit out some output. MVC works here because the number of questions is variable (determined by the Model), the code to direct responses is always the same (the Controller), and the look-and-feel of the questions should be uniform (the View).