-3

I need to get from the user date and time. I want that will open a calendar and the user will choose the date & time (like in Microsoft Office).

Is this possible? How can you do it?

example:

image http://s1.postimg.org/oq6vtfv63/pic.jpg

Serge Ballesta
  • 143,923
  • 11
  • 122
  • 252
user2188596
  • 1
  • 1
  • 5
  • 1
    You probably need to google something like "java date time picker". When you will try to create/use one of them and you will have some problems with code come back and ask about these problems. For now it looks like you are asking us to write it for you, or to suggest one of tools/libraries. Both these requests are off-topic here. – Pshemo Jul 20 '14 at 14:18
  • Thanks! @Pshemo. what about the time? possible? No. I did not know "java date picker". Thank you very much, and I'm sorry about that. – user2188596 Jul 20 '14 at 14:20
  • Yes, it is possible. Anyway check my [updated comment](http://stackoverflow.com/questions/24851351/add-datetime-with-calendar#comment38589481_24851351). – Pshemo Jul 20 '14 at 14:23
  • Maybe this will interest you http://stackoverflow.com/questions/654342/is-there-any-good-and-free-date-and-time-picker-available-for-java-swing – Pshemo Jul 20 '14 at 14:25

1 Answers1

1

You can use JDatePicker from http://jdatepicker.org/.

It looks like enter image description here

There are some code snippets How to use JDatePicker to display calendar component, for example to create the picker shown above:

UtilDateModel model = new UtilDateModel();
JDatePanelImpl datePanel = new JDatePanelImpl(model);
JDatePickerImpl datePicker = new JDatePickerImpl(datePanel);

frame.add(datePicker);
DavidPostill
  • 7,734
  • 9
  • 41
  • 60