Swing Calendar Control

As a wee project during some down time I decided to see how hard it would be to write a Swing component from scratch. This is the result.

Swing has a prominent absence of any useful date controls. In particular we need a decent cross-platform date entry control, but an iCal or Outlook style calendar is also absent. This is a decent chunk of the way towards writing one although it's not yet complete.

What you can do is drag to create and move appointments. What you can't do is create recurring or 'no time' appointments. And there's no support for side-by-side concurrent appointments as yet - they just overlap. Oh, and there are bugs. Bugs like you wouldn't find outside of a Microsoft product.

With those caveats, here's a applet for demo purposes (although there does seem to be a draw bug on the applet where the first drawn item doesn't appears... weird), and a link to the BSD licensed source.

Download the source (version 0.4, 36Kb, BSD licence).

  • 0.4 - Bug fixes. Dragging multi-column items and resizing while scrolling now work. Also, resize direction switches when appropriate.
  • 0.3 - Fixed disappearing appointments in leftmost column
  • 0.2 - Initial public release

 

Just drag to create an appointment...

If the applet isn't working it will be either because you don't have Java 1.5 or because I've been lazy and haven't added object tag support for IE. In which case: use FireFox.