06 - JavaFX Tutorial - Validate TextFields FXML

preview_player
Показать описание
In this little Tutorial i create two Custom TextFields, one NumberTextField which accepts only numbers and a OnlyCharacterTextField and we use both of the within a FXML File.
Рекомендации по теме
Комментарии
Автор

I have the import correctly it works perfect and I can't see the components in scenebuilder, also can't set the margin of the textfield anymore. Any help?

nshusa
Автор

Hi, how drag and drop a TableRow from TableView to out TableView (to ImageView for example)

excelavanzadoYA
Автор

Thanks again for this great short tutorial! I hoped you could help me with a small question:
Is there a way with the NumberTextField to force the user to only be able to input no more than two numbers after the decimal point?

jorisvanlaar
Автор

Hey, i have a question... why doesn't the backspace work for the NumberTextFieldValidation

CurtisBoakye-Yiadom-bgsf
Автор

Thanks Patrick for your example, I have a qq, how can I verify user input? I have a text area that will take a list of IP addresses and 2 sets of radio button.

mametel
Автор

great example patrick, thanks for this...i have a question though.  when i mix this tutorial and your other one with multiple scenes it throws an error when i switch to the second scene that has the custom control.  do you know how to solve this issue?

chuckrobertson
Автор

It SEEMS working but there is a bug.
You write a regex that match the input DURING THE DIGITATION. So you can input only ending characters, else the string is not valid. For examples, if you want to validate emails, you CANNOT insert the "@", because an email address cannot finish by "@". You cannot have a list of numbers separated by comma, if the comma cannot be ending character, else you cannot digit comma. A similar problem is with backspace. To allow a mail address, you have to rewrite your regex to allow "@" at the end... so this is not a real validation.
That's why you wrote so simple examples: only letters or only numbers, and you cannot validate a "real", more complex input field.

umegghju
Автор

Brother, thank you very much. 

working perfect, excellent. 

but now I have the following problems: 

1 - What I can not open the scene builder, generates an error when the line is addition, <import validatetextfield.custom?> 

if you want to see what I did, send me your email to send you my learning project.

yesidcalle
Автор

hello patrick great tutoriel all are good but i have Probleme when i try to emty the field it doesn't be empty

mejrielyes
Автор

If we go that way and save fxml, we cant see this textfields in Scene Builder or edit right?

trebleclef
Автор

wauuu, incredible!, Fantastic, great, thanks. I go to work immediately. 

I must say that is different than what I imagine, because I see that you use the onkeyType, or another function within the scene builder. 

I must thank you very much, because nobody has answered before me, only you. 

Thank you. 
at some point I will have other questions. 
¿ I can consult you Later?

yesidcalle
Автор

when shalt put more tutorial videos scene builder javafx 2.0? 
examples of CRUD with BD?. 
this link, I have also guided 
JavaFX - Working With Tabs 
I did it in netbeans 7.4 with 2.0 and perfect scene builder. 
but try to do it in netbeans scene builder 8.0 and 2.0, and could not do. why? 
that much difference between a version and another?

yesidcalle
Автор

Hey dude! i have a problem, when i press backspace on my keyboard dont delete the characters on the text field!

franciscofigueredo
Автор

incredible!

But its don't clean the TextField,

example: if a put 123, the backspace doesn't work, can you help-me?

ueletonando