Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is JavaFX 8 going to implement text field validation support?

JavaFX 2 does not provide validation support (masks, input filtering and so on...). It is difficult to adopt a technology that does not offer basic functionalities. I am trying to implement my own validators, but that is a big pain.

Are there any news in JavaFX 8 about validation? I was trying to find new features, but I don't know where to search, it is difficult to find exactly what will be the changes in JavaFX 8. I need to know about it, because I was considering JavaFX for a new application.

like image 263
ceklock Avatar asked Mar 10 '14 01:03

ceklock


People also ask

How to make text fields in JavaFX?

To create a text field, you need to instantiate the TextField class, to the constructor of this class you can also pass a string value which will be the initial text of the text field.

What is TextField in JavaFX?

TextField class is a part of JavaFX package. It is a component that allows the user to enter a line of unformatted text, it does not allow multi-line input it only allows the user to enter a single line of text. The text can then be used as per requirement.

What is ValidatorFX?

ValidatorFX is a validation library for JavaFX. It is inspired by ControlsFX but tries to overcome its shortcomings: Validations based on arbitrary observable values (not just the value of a control) Validations can decorate an arbitrary number of nodes (not just the one control)


1 Answers

Answer

No, JavaFX 8 will not implement high level validation support.

Opinion

I think it unlikely that comprehensive validation support will ever be in the JavaFX core libraries (this is just my personal opinion).

JavaFX provides a base library upon which other libraries can be implemented. JavaFX 2.2 provides enough support that you could write validation libraries on top of JavaFX (and people have done so).

There are some reasons why you might not want validation support in JavaFX core libraries:

  1. As JavaFX is part of Java SE and the open-jfx project, it must follow the Java release process, which can be quite slow at times for various reasons. 3rd party projects don't have such restrictions.
  2. Things in JavaFX implement just one way of doing things generally, whereas you might wish to have multiple frameworks built on JavaFX, each for different purposes, then choose between the framework which best meets your needs.
  3. Some advanced validation frameworks might make use of things such as Beans Validation, which are currently only part of the Java EE specification. JavaFX is written to work with just Java SE, so the core framework can't make use of anything from Java EE, even though that might be desirable for validation.
  4. Generally, validation is not something done in isolation, but is often part of a wider framework (such as a form filling framework or a complete application platform).

3rd Party Validation Libraries

Some sample 3rd party libraries which perform validation for JavaFX fields are:

  • JideFX
  • FXForm2

I was trying to find new features, but I don't know where to search, it is difficult to find exactly what will be the changes in JavaFX 8.

I am sure, when Java 8 is officially released in a couple of weeks, it will come with an announcement summarizing new JavaFX features.

You can find out what all of the new features for JavaFX 8 are by filtering the JavaFX issue tracker on fixed features for Java 8. Here is a link to the result of a JavaFX 8 fixed feature query. Note, the linked query reports only larger features, not minor tweaks.

like image 133
jewelsea Avatar answered Oct 23 '22 10:10

jewelsea