Created
February 15, 2016 13:46
-
-
Save codenameone/5e437d82812dfcbdf092 to your computer and use it in GitHub Desktop.
The varius ways in which the Picker class from Codename One can be used
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Form hi = new Form("Picker", new BoxLayout(BoxLayout.Y_AXIS)); | |
Picker datePicker = new Picker(); | |
datePicker.setType(Display.PICKER_TYPE_DATE); | |
Picker dateTimePicker = new Picker(); | |
dateTimePicker.setType(Display.PICKER_TYPE_DATE_AND_TIME); | |
Picker timePicker = new Picker(); | |
timePicker.setType(Display.PICKER_TYPE_TIME); | |
Picker stringPicker = new Picker(); | |
stringPicker.setType(Display.PICKER_TYPE_STRINGS); | |
datePicker.setDate(new Date()); | |
dateTimePicker.setDate(new Date()); | |
timePicker.setTime(10 * 60); // 10:00AM = Minutes since midnight | |
stringPicker.setStrings("A Game of Thrones", "A Clash Of Kings", "A Storm Of Swords", "A Feast For Crows", | |
"A Dance With Dragons", "The Winds of Winter", "A Dream of Spring"); | |
stringPicker.setSelectedString("A Game of Thrones"); | |
hi.add(datePicker).add(dateTimePicker).add(timePicker).add(stringPicker); | |
hi.show(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Sample usage of Picker.
From the Codename One project