I have downloaded and installed the "Simple Validation" NetBeans Plug-in, but do not know how to use it, because I cannot find where is it present (in toolbox).
Can anyone kindly help me by telling how where can I find it and what are the steps to apply the validation on my form fields.
I also saw there was a Validation API JAR file and I downloaded and included it in my project. It provided 3 controls (or whatever I should say); "ValidationPanel", "ValidationUtils" and "Problems". I saw an example at a website & followed it. I dragged-and-dropped the "ValidationPanel" and wrote the code as shown in following code
final ValidationGroup group = validationPanel1.getValidationGroup();
group.add(txtUserName, Validators.REQUIRE_NON_EMPTY_STRING,
Validators.NO_WHITESPACE,
Validators.REQUIRE_VALID_INTEGER);
But it seems JAR file contains incomplete files or there may be other problem, because it gives error: cannot find symbol: variable "Validators"
I am sorry I think these are 2 questions, but kindly help me how to solve it.
Thanks in advance
You just want the "ValidationPanel".
It seems to be called "org.netbeans.validation.api.builtin.stringvalidation.StringValidators" now.
final ValidationGroup group = validationPanel1.getValidationGroup();
group.add(txtUserName, StringValidators.REQUIRE_NON_EMPTY_STRING,
StringValidators.NO_WHITESPACE,
StringValidators.REQUIRE_VALID_INTEGER);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With