This website uses cookies for visitor traffic analysis. By using the website, you agree with storing the cookies on your computer.More information

Custom comboboxes with JavaFX

We got great feedback about our first beta release of our JavaFX UI. Many of our ideas were right but our comboxes weren't good enough. We had missing features and some technical problems. One missing feature was: Live search in comboboxes with list of values. Our old implementation of comboboxes was like this:

Combo Box

Combo Box

Our implementation didn't support live filtering, e.g. if you typed a key, the list wasn't shortened...

One problem with this feature was JavaFX' focus handling and popups. It was tricky to keep the focus in the right editor and to keep the popup open or to re-open the popup after every keypress. We had a solution but it was too dirty. So we tried to find a better solution. We moved the the editor in the popup, to avoid focus problems. We had crazy effects with two blinking cursors in two different text fields, very strange.

Our current solution is this:

Filterable combobox

Filterable combobox

The design is not perfect but we're working on it. The good thing is that we have no problems with focus and filtering is already working. Here's a screenshot of our date editor:

Date editor in combobox

Date editor in combobox

Our date editor needs a small redesign but it's working. The optimization was planned for release 1.1

If you're interested in our current state, check the source code. We're looking forward to your feedback!

Our code is open source and we still have a separete lib (.ext) for all custom FX controls. The UI implementation for JVx is based on this library. So we have JVx independent JavaFX extensions and our JVx UI implementation.

6 Responses to “Custom comboboxes with JavaFX”

  1. Sarah says:

    What specific open source license do you use for your code? Is it commercial friendly? I would like to make use of your examples here, but cannot use a viral license like the gpl

  2. rjahn says:

    Apache 2.0

  3. Eden says:

    What is name of source file with filterable combobox in source directory because i can't find it?

  4. Fred says:

    Any sample code which uses this control? Your kitchensink application does not include it.

  5. rjahn says:

    We don't use it without JVx' model and don't have a custom test class for it, but there's a simple implementation: FXDateTimeComboBox

    This should help you.

Leave a Reply

Spam protection by WP Captcha-Free