Date Time Picker like in Windows - java

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!

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
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,
in both cases you have to implementing own workaround for SpecialDays as hollydays (and etc),

Related

Calendar in Android with everyday choice button

I'm a begginer in Android development (Java language) and would gladly appreciate any advice on how to create my project. In this part, I would like to add buttons assessing user's mood (good, average, bad) so that everyday he can make such a choice. The choice would be saved in the calendar and seen as a appropriate background colour of a particular date.
For example, like here:
I would like to mark that way all days, colour depending on the choice made.
I tried implementing Caldroid, but apparently I do something wrong because it can't be read - tried to fix it numerous ways. So maybe some other solution?

Customize DatePicker to select year and month

The current JavaFX implementation of a DatePicker only allows you to select a year and month by clicking the < > buttons. Most modern implementations of DatePicker allow you to select the year for example like this:
How do we get this functionality?
So far I have not seen a datepicker with that feature in JavaFX. Neither the javafx.scene.control.DatePicker nor the ControlsFX- and JFXtras-controls have such a functionality as far as I know (ControlsFX even doesn't provide a datepicker to my knowledge).
However on http://calendarcontrolinjavafx.blogspot.com/2012/01/calendar-control-in-javafx-20.html there is a custom datepicker with such a functionality (but with a different style) together with a demo application.
Unfortunately the implementation is from 2012 and is in JavaFX 2. However, with minimal changes it runs with >= JavaFX 8. Below are a few snapshots. I have no idea concerning the stability but maybe it's worth a try.
I am not sure if you needed a year picker or a year-month picker but I assume the latter. I also needed one for year-months and could not find anything that works for javafx 8 or above so I wrote one: https://github.com/perNyfelt/fx-yearmonth-picker.

SWT Nebula CDateTime DateSelection

I want to use the Nebula CDateTime component, but I have the problem, that the selected date is not marked in the panel (selected is the 17):
What do I need to change so that the selected date ishighlighted?
There's a bug report about this:
Highlighting feature for CDateTime. There's also code that you could use to get it working in your code.
Unfortunately, it doesn't seem to ever have made it into the release version for whatever reason.

Entering and editing time in JTable

I have this JTable where the user inserts bus timetables. And I want it to have Windows like time editing template (being able to enter time from keyboard and mouse). Like:
12:00↕
Arrows meaning two buttons up/down for moving hours and minutes.
I couldn't find the premade JComponent like this or to be more precise I couldn't name it properly for google search, so don't get angry with such simple question, but how to do it?
if you're bound to use swing you have to write your own TableCellEditor, best practive would be to sublass AbstractCellEditor.
Use JSpinner to edit the values, JSpinner is the up/down-Button widget...
if you have furhter question, feel free to ask more on stackoverflow....
You might want to look at this. The basic idea is that you override the SpinnerEditor class and add a spinner in the cell. To do what you want and have a layout like JSpinner:JSpinner, you should probably add a JLabel and another JSpinner. Also, the getCellEditorValue() method will have to return some sort of time object (unless you want to use military time).

JDateChooser is not displaying any dates

I am using the below library JDateChooser, which is a Date Picker GUI which we can put into Netbeans pallet.
http://plugins.netbeans.org/plugin/658/jdatechooser-1-2
However this do not display any dates. Dates are empty. Below is the image.
I do not have to post the code here, because I did nothing other than dragging and dropping the GUI element. Can someone please tell me why this is happening?
JDateChooser from vadimig doesn't seem to work with Nimbus, seems to work okay for Windows look and feel, you'd have to test it with the other system looks feels.
Either change the component you are using or change the look and feel you are using
The problem is the width of the component, just increase that value.
If your DateChooserCombo is called chooserDate, it must be like this:
Dimension size = chooserDate.getCalendarPreferredSize();<br>
size.width += 90;<br>
chooserDate.setCalendarPreferredSize(size);<br>

Categories

Resources