Open Source JavaFX Now!

JFXtras Core Logo

XPicker

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_DOWNSIDE_SCROLLTHUMB_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.

Sample Code


XPicker { pickerType: XPickerType.SIDE_SCROLL cyclic: true items: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"] }

General Options

(see JavaFXDoc for details)

ParameterDefaultDescription
pickerType:DROP_DOWNThe 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:0Index of the item to show initially selected
dropDown:trueIndicates if a dropdown list will appear when clicked
dropDownSize:120The size in pixels of the dropdown that will appear
cyclic:falseIndicates if the list of items will cycle back to first when scrolled past end and vice-versa
onCycleFunction defining the action to take on the event of the item list cycling
firstLetter:falseKeystroke will rotate through all items with the first letter keyed
showFocus:trueAllows the focus border to be turned off
controlOnLeft:falseIf a single control picker, places the control on the left rather than defaulting to right
upArrowIncreases:falseReverses the normal up/down direction for THUMB_WHEEL
noText:falseTurns a THUMB_WHEEL into a nudger style with no text in the control
mouseRepeatDelay0.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?)

<< Back to JFXtras FrontPage < Back to Controls
6 Attachments 6 Attachments
3524 Views