Im looking for a pretty and decent time picker component. There are a lot of alternatives for date picking on Swing but no for time.
I've seen nice Date/Time components picking on JQuery ( for example: http://trentrichardson.com/examples/timepicker/ ). There is something similar on Swing?
Thanks in advance.
The J identifies all Swing components. Swing used to be marketed as Java Foundation Classes, before it became an integral part of the JDK. +1: It also made it less of a headache to include both AWT classes and Swing classes in the same source file.
JSpinner is a part of javax. swing package. JSpinner contains a single line of input which might be a number or a object from an ordered sequence. The user can manually type in a legal data into the text field of the spinner. The spinner is sometimes preferred because they do not need a drop down list.
Most Swing components have models. A button ( JButton ), for example, has a model (a ButtonModel object) that stores the button's state — what its keyboard mnemonic is, whether it's enabled, selected, or pressed, and so on. Some components have multiple models.
Use JSpinner with SpinnerNumberModel
I would suggest the TimePicker component of the LGoodDatePicker library. The time can be chosen with the (default) "drop down" menu, with (optional) "spinner" style buttons, or both.
Fair disclosure: I'm the primary developer.
The TimePicker can be customized with optional settings. A few of the settings are the language (locale), default times in the drop down menu, fonts and colors, display/menu/parsing formats, 12 or 24 hour clock, seconds or nanoseconds precision, and so forth.
The library also includes the DatePicker and DateTimePicker components. All three components are easy to use. (They can each be instantiated with a single line of code.)
I've pasted screenshots of the components and the demo application below.
Project Home page: https://github.com/LGoodDatePicker/LGoodDatePicker .
( Click to enlarge the demo screenshot. )
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With