This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Java in General and the fly likes Calendar Control Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Calendar Control" Watch "Calendar Control" New topic

Calendar Control

Justin Char
Ranch Hand

Joined: Mar 05, 2007
Posts: 76
import org.jdesktop.swing.JXDatePicker;

Does anyone have a better Calendar Control than the above?
Rob Spoor

Joined: Oct 27, 2005
Posts: 19674

Not really. I have written my own DateChooser which uses a JSpinner for the year and a JSpinner with a SpinnerListModel and a custom combo box spinner editor for the months (loaded from the default locale or a specified locale) but for the rest it's basically the same.

I also written a DateSelecter class which does the same but can have a custom controller for changing the month and year, and can also have multiple controllers (like the arrow thingy of JXDatePicker or the spinners from DateChooser).

Neither have a one-line control though, although you could use a regular JSpinner and a button behind it that shows the dialog. That's mostly how I use them.

How To Ask Questions How To Answer Questions
I agree. Here's the link:
subject: Calendar Control