java - JAVAFx TextField Validation Decimal value -
i try restrict textfield decimal numbers, found solution integer number validation here, problem not able convert following code decimal numbers, 324.23, 4.3, 4, 2, 10.43. (only 1 decimal point allow).
vendorlist_textfield_remaining.textproperty().addlistener(new changelistener<string>() { @override public void changed(observablevalue<? extends string> observable, string oldvalue, string newvalue) { if (!newvalue.matches("\\d*")) { vendorlist_textfield_remaining.settext(newvalue.replaceall("[^\\d||.]", "")); } } });
i looking alternative solutions. thanks.
there excellent field validation components in jidefx-oss project, including 1 decimal numbers.
Comments
Post a Comment