像 Windows 中的日期时间选择器
我正在寻找一个 Swing 组件,它可以完成与 Windows 7 日期和时间选择器相同的操作(甚至更好)。它们看起来是这样的:
并具有我需要的以下功能:
- 您不能输入无效值(当您输入值时,该值将被忽略)键入而不是在您离开字段时)
- 它允许持续更新字段,直到用户进行第一次更改(查看 Windows 7 中的时间设置)
- 您一次只能选择和更改一个位置 - 而不是整个文本立即(因此无法删除冒号和点)
- 向上和向下按钮
- 日历按钮(但它对我来说是可选的)
我已经尝试过使用 DateEditor 的 JSpinner,但它没有此功能。 JXDatePicker仅添加日历按钮。
一般来说,我正在寻找一种好方法让用户以一种强大而简单的方式输入日期和时间。 Windows 7 的解决方案似乎相当不错。
谢谢你!
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:
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)
- 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.
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.
Thank you!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
最好且免费的 DatePickers 是
JXDatePicker
和 JCalendar,在这两种情况下是否有关于Date
和Focus
解决方法的正确实现以及JTree / JTreeTable / 的优秀
Renderer 和 Editor
的关注JTable满足您的需求 --->所有这些功能都是默认实现的,从你的问题中不清楚到底出了什么问题,我是
Win7
和JXDatePicker
和JCalendar
但我从未见过这些问题,在这两种情况下,您都必须为
SpecialDays
作为节日(等)实施自己的解决方法,best and free DatePickers around are
JXDatePicker
and JCalendar, in both cases are there focus about correct implementations ofDate
andFocus
workaround, and excelentRenderer and Editor
forJTree / JTreeTable / JTable
to your needs ---> all these funcionalities are implemented by default, not clear from your questions exactly whats wrong, I'm
Win7
andJXDatePicker
andJCalendar
but I never saw these issues,in both cases you have to implementing own workaround for
SpecialDays
as hollydays (and etc),