Menu

QuickStart Guide

John Dalbey

QuickStart Guide

Add the time selection field to your Swing application with two lines of code:

TimeSelectionField starttime = new TimeSelectionField();
add(starttime); 

Access the selected time via one of two accessor methods. The getSelectedTime method returns a Java Date object. The getText method returns a formatted String.

Date selectedTime = starttime.getSelectedTime();

or

String timeString = starttime.getText();

You can also add a listener (in the same manner as JComboBox) so you can be notified when a time is selected.

For more info, view the javadoc and the examples folder in the code repository.


Related

Wiki: Home