简体   繁体   中英

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.

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:

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM