Dates are one of the most fundamental data types, so any language or database provides support for them, either built in or as a class library. Java is no exception; the Java API provides support for representing, computing, comparing, displaying, and parsing dates in a portable, cross-platform and language-independent way. In this article I present a custom control for Swing that allows you to visually pick a date instead of typing it. This way you can avoid invalid dates altogether and offer the user a visual clue as a bonus. |