|
Replies:
1
-
Last Post:
Nov 14, 2008 4:35 AM
by: osbald
|
|
|
|
|
|
|
How to select dates than span months?
Posted:
Nov 13, 2008 3:01 PM
|
|
|
I tried using JXMonthView but it only lets me select a range of dates within a single month.
The closest I've seen to the behavior I'm looking for is Windows Vista's Calendar application. Clicking the mouse button and dragging to the bottom right automatically scrolls to the next month(s). Dragging to the top left scrolls to the previous months.
There is also Google Analytics that lets you pick the start date and end date without dragging but does so without opening and closing new calendars every time.
What is the acceptable behavior in this case? Do you simply use two JXDatePickers?
Thank you, Gili
Message was edited by: cowwoc
|
|
|
|
|
|
|
Re: How to select dates than span months?
Posted:
Nov 14, 2008 4:34 AM
in response to: cowwoc
|
|
|
Certainly I've used two JXDatePickers for ranges before. I've also added a combo for common preselected ranges and a quick-pick button that'll show a JXMonthView to select both dates (custom choice) via selection. http://picasaweb.google.co.uk/osbald/DateRangePicker
You may get some mileage from using a custom JXMonthView popup and making it larger than one month. JXMonthView will show as many months as it has space for. With several months you can span your selection across months (given relatively short ranges < x months). Try the swingx demo on swinglabs.org to play with JXMonthView.
Negatives here are I'm not convinced the navigation controls, at the top of each month work so well in this mode and it's shame you can't specify where the current month should appear (as in start, middle or end for picking a future date, recent range or a near past date).
JXDatePicker should only be used for a picking single date.
|
|
|
|
|