Seeking feedback on a possible JDatePicker Swing component

Brice Dutheil brice.dutheil at gmail.com
Tue Aug 27 10:42:18 UTC 2024


**Is it of interest ?**

I believe it is of interest.

**Would you use it ?**

If date / time input is definitely necessary, much better than searching
for various implementations having varying quality / support.
However recently we had to write a Combo like for time range (e.g. `Aug 25,
11:52 am – Aug 27, 11:52 am` , and drop down with options like Past X
Hours, Past X Days), which is a tad different than a date time picker.

**What features must it have ?**

While I tend to agree with the enumerated features of SWinxy and Andy
Goryachev, I believe the model should be open and extensible enough to
support features that are nice but non critical (e.g. one may want to
select multiple dates, or a range).
I believe the formatting in particular should work for multiple locales and
multiple formats, as french dates are entered in a human way, but
recognizing ISO 8601 could be nice as well.

On the Swing aspect : I believe there should be three main components
working together but usable on their own :

1. A combobox-like with a text field using a customizable parser. This
combobox-like could create a popup that can be any component (current
combobox do not allow anything else than a JList based popup). This would
allow one to customize the popup (placement left-right, width and its
content, e.g. two months, adding other controls on any side) or even reuse
this combobox-like for other purposes (e.g. an hex color text whose popup
is a color picker).
2. The combobox-like editor could benefit from being date time aware, e.g.
to select parts like the month or the minute.
3. The calendar time view, that could be used outside the popup, e.g. for a
multi-month panel. This calendar view should allow some tweaking of the
rendering (decorations), e.g. one may want to reuse this calendar view to
represent something that spans over an interval (like on multiple days).
The calendar should support mouse motion, when hovering, to tweak the day
or a span over days (that may be represented as line, or dots, etc).

So for example one could compose these components to create a time-range
selector.

**What features are nice to have ?**

I believe some features like OS formatting are nice but not essential and
possibly not wanted.

**Do you have any experiences of other date pickers that reinforce those
responses ?**
I have used the Datadog time range picker which is very practical to use
from a user standpoint.

**Anything else ?**
Nothing at this time

-- Brice


On Mon, Aug 26, 2024 at 4:27 PM Taylor Smock <taylor.smock at kaart.com> wrote:

> On 8/21/24 23:00, Tejesh R wrote:
> > Hello Swing Community,
> > [...] so we are considering revisiting the idea of a Date Picker in core
> Swing. [...]
> > - Is it of interest ?
> Yes. The OSS application I work on (https://josm.openstreetmap.de) has
> some areas in the UI where it would be nice to have a date picker. Some
> plugins for the app use third-party components to provide a date picker UI,
> but the non-plugin date pickers are text only.
> > - Would you use it ?
> Yes. Eventually -- whenever we make the version of Java with the date
> picker the minimum required version. That will probably be a decade after
> GA for the date picker. For reference, we only stopped supporting Java 8 in
> the past year. We still support Java 11, and we will _likely_ be held back
> by the default-jre in Debian going forward.
> We *do* support the latest Java versions, but for our users, we try to
> support as many versions of possible (we distribute jlink binaries, jars,
> and jnlp files (for OpenWebStart)).
> > - What features must it have ?
> For our usage, we just need users to be able to pick dates; almost all of
> our use cases don't require time as well.
> So:
> * User selection of a date
> > - What features are nice to have ?
> * User selection of a date range -- this can be done outside of the JDK if
> necessary.
> > - Do you have any experiences of other date pickers that reinforce those
> responses ?
> I've used https://github.com/JDatePicker/JDatePicker in the past in a
> plugin for the OSS application.
> > - Anything else ?
> No.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/client-libs-dev/attachments/20240827/475375ef/attachment.htm>


More information about the client-libs-dev mailing list