日期时间选择器,如在Windows中

时间:2022-09-26 11:19:05

I am looking for a component for Swing that would do the same thing that Windows 7 date and time pickers do (or be even better). They look so:

我正在寻找一个Swing的组件,它可以做与Windows 7日期和时间选择器相同的事情(或者更好)。他们看起来如此:

日期时间选择器,如在Windows中

And have following features I need:

并具有以下我需要的功能:

  • you cannot enter an invalid value (value is ignored as you type and not when you leave the field)
  • 您无法输入无效值(键入时会忽略值,而不会在您离开字段时忽略值)

  • it allows continuous updating of the field until the first change made by user (take a look on the time setting in Windows 7)
  • 它允许连续更新字段,直到用户进行第一次更改(查看Windows 7中的时间设置)

  • you can select and change at once only one position - not the whole text at once (so colons and points cannot be removed)
  • 您可以一次只选择和更改一个位置 - 而不是一次更改整个文本(因此无法删除冒号和点)

  • up and down buttons
  • 上下按钮

  • calendar button (but it's rather optional for me)
  • 日历按钮(但对我来说它是可选的)

I have tried JSpinner with a DateEditor but it doesn't have this features. JXDatePicker only adds the calendar button.

我尝试过使用DateEditor的JSpinner,但它没有这个功能。 JXDatePicker只添加日历按钮。

Generally I am looking for a nice way to let user enter date and time in a powerful and simple way. Windows 7 solution seems to be quite good.

一般来说,我正在寻找一种让用户以强大而简单的方式输入日期和时间的好方法。 Windows 7解决方案似乎相当不错。

Thank you!

1 个解决方案

#1


3  

best and free DatePickers around are JXDatePicker and JCalendar, in both cases are there focus about correct implementations of Date and Focus workaround, and excelent Renderer and Editor for JTree / JTreeTable / JTable

最好和免费的DatePickers是JXDatePicker和JCalendar,在这两种情况下都关注日期和焦点工作方式的正确实现,以及JTree / JTreeTable / JTable的优秀渲染器和编辑器

to your needs ---> all these funcionalities are implemented by default, not clear from your questions exactly whats wrong, I'm Win7 and JXDatePicker and JCalendar but I never saw these issues,

根据你的需要--->所有这些功能都是默认实现的,不清楚你的问题究竟是什么错误,我是Win7和JXDatePicker和JCalendar但是我从未见过这些问题,

in both cases you have to implementing own workaround for SpecialDays as hollydays (and etc),

在这两种情况下,您必须为SpecialDays实现自己的解决方法作为hollydays(等),

#1


3  

best and free DatePickers around are JXDatePicker and JCalendar, in both cases are there focus about correct implementations of Date and Focus workaround, and excelent Renderer and Editor for JTree / JTreeTable / JTable

最好和免费的DatePickers是JXDatePicker和JCalendar,在这两种情况下都关注日期和焦点工作方式的正确实现,以及JTree / JTreeTable / JTable的优秀渲染器和编辑器

to your needs ---> all these funcionalities are implemented by default, not clear from your questions exactly whats wrong, I'm Win7 and JXDatePicker and JCalendar but I never saw these issues,

根据你的需要--->所有这些功能都是默认实现的,不清楚你的问题究竟是什么错误,我是Win7和JXDatePicker和JCalendar但是我从未见过这些问题,

in both cases you have to implementing own workaround for SpecialDays as hollydays (and etc),

在这两种情况下,您必须为SpecialDays实现自己的解决方法作为hollydays(等),