JDK-8132331 : Standard TextFormatter instances
  • Type: Enhancement
  • Component: javafx
  • Sub-Component: controls
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: generic
  • CPU: generic
  • Submitted: 2015-07-24
  • Updated: 2015-07-27
  • Resolved: 2015-07-27
Related Reports
Duplicate :  
Description
It is a rather common request from application users that they want an application to not allow "unwanted" or "unparseable" characters to be entered into text input controls. For example, a TextField bound to an integer should not accept letters.

While TextFormatter is available since 8u40 and provides a basic solution to that, it is a real pain to configure, particularly in FXML-driven projects.

It would be great if a future release of JavaFX would provide predefined, locale-bound TextFormatter instances which can be referenced from FXML.

Example:

<TextField textFormatter="$INTEGER_FORMATTER" />
<TextField textFormatter="$DECIMAL_FORMATTER" />
Comments
This should already be covered by JDK-8090453. Feel free to add more information to that JIRA.
27-07-2015