XPicker is a multi-format Picker control for choosing an entry or value from a sequence of values using various visual and interaction styles.
The basic formats available and there enumeration are:
DROP_DOWN A standard combobox style control
SIDE_SCROLL A combobox with left and right scrolling
THUMB_WHEEL A control with bidirectional movement for numeric selection
Examples
DROP_DOWN
SIDE_SCROLL
THUMB_WHEEL (normal)
THUMB_WHEEL (nudger)
Unexpanded
Expanded
Try it out
If you would like to try a sample of how this control operates, please click here to launch the Sample.
The code for this sample can be downloaded from JFXtras through svn.
Features
Item selection may be cyclic such that scrolling carries on round the list of items, e.g. the 12 month year, and this may be monitored to initiate other events on cycling.
Changes to the items list may be carried out dynamically, and the control will resynchronize itself to remain consistent.
Picker will respond to mouse, scroll wheel and keys, however the effects will vary slightly depending on the Picker variant.
The basic Picker type to utilise, one of PickerType.DROP_DOWN, SIDE_SCROLL or THUMB_WHEEL
items:
The sequence of items to utilise in the Picker
preset:
0
Index of the item to show initially selected
dropDown:
true
Indicates if a dropdown list will appear when clicked
dropDownSize:
120
The size in pixels of the dropdown that will appear
cyclic:
false
Indicates if the list of items will cycle back to first when scrolled past end and vice-versa
onCycle
Function defining the action to take on the event of the item list cycling
firstLetter:
false
Keystroke will rotate through all items with the first letter keyed
showFocus:
true
Allows the focus border to be turned off
controlOnLeft:
false
If a single control picker, places the control on the left rather than defaulting to right
upArrowIncreases:
false
Reverses the normal up/down direction for THUMB_WHEEL
noText:
false
Turns a THUMB_WHEEL into a nudger style with no text in the control
mouseRepeatDelay
0.5s
The delay before a mouse press held down will be treated as a repeat scroll
Other options are available, including public variables and methods which are detailed in the JavaFXDoc (THIS SHOULD BE LINK? CAN IT BE TO XPicker in JavaFXDoc?)