+everest108 I think my education is rather good, it really just me lol... I have a hard time paying attention so it's nice to go back and brush up on some code after watching these
@@TimoBaader Hundred Procent, i did it with lsd and my concetration problem and learn problems went miles away. It helps me so much in my current universary time
Using regex is better idea in my opinion ;p you can't validate more difficult strings by comparing them to int like it is in yours method. By regex you can define whatever you want as a pattern. Let's goole that for more info ...
Hello. Why do you have 2 parameters for your function isInt(TextField input, String message). Then you use at first input.getText() and then mesage, Isn't it better when you only use message and delete TextField input?
+Patrick Pfeiler He mentioned the reason of it in the video. He wanted to show two ways of doing that and in addition you can use them for a bit different purposes. Watch again more carefoully :)
The TextField input parameter gives him a reference to the actual TextField object on the GUI, so he can alter it (change width, height, position, color, text in the field, etc). The String parameters will allow him to use String manipulation as needed, such as splitting, substrings, comparing in RegEx, etc. Say you wanted the background color of the TextField to turn red/orange if a character is a letter, you would need the TextField object to be passed in to alter the background color.
You have to do two things - validate the input and handle the error case. The validation can be performed by the isInt() method, which returns true or false. The error handling should be done somewhere else (since it is not a part of determining if something is actually an Integer) - either directly in the lambda passed to the Button, or in a error handling method. You could also combine the two into a single method like verifyAge() that is called from the Buttons OnClick Event-Handler (this is pretty much what Bucky did, but with better naming).
2 years too late to reply now but in this code offcourse it's not needed but it's good to divide your code in small chunks so you can return boolean at the end and depending on the boolean, handle the result outside of the function instead of handling inside isInt(). Depends on your liking :)
Hello! If I want to introduce text in the TextField how can i check if what I insert there is a name(string) and not a number or something else? Please help me!
hey ! i was doing the same thing , but I am getting Nullpointer exception when i try to output the text in the text field, i had assigned it an fx: id in scene builder
why do you need to pass the string also, you already have it from the input, think it's more intuitive and cleaner. i mean, it's not important, just saying. this tutorial is great by the way
sup bucky love you m8 these tutorials are getting me through college lol
+Jonnie Z Says a lot about the current education system.
+everest108 I think my education is rather good, it really just me lol... I have a hard time paying attention so it's nice to go back and brush up on some code after watching these
same here
@@JonnieZuramski try microdosing mushrooms (not even joking)
@@TimoBaader Hundred Procent, i did it with lsd and my concetration problem and learn problems went miles away. It helps me so much in my current universary time
Without your tutorials I would have killed myself by now
For some reason I thought "my age is tuna fish" was really funny. Have a like! :)
at the end, home boy is like, aight, i'mma head out n get some lean
Very useful video for so practical issues! Thanks a lot :)
This voice in 2020! They would quarantine you! And send you to Covid 19 test!!! hhhhhhhh Lucky 2015 !!
Are you the guy from "Casually Explained"?? haha your voice just looks like his.. Your tuts rock ;)
His voice is darn adorable!
It doesn't check if the input number is positive or negative. You can input a negative age and it is valid. Keep that in mind.
Then How Can We Also Validate That ?
Bucky, Dont Worry! We know you don't Smoke!
Using regex is better idea in my opinion ;p you can't validate more difficult strings by comparing them to int like it is in yours method. By regex you can define whatever you want as a pattern. Let's goole that for more info ...
Hello.
Why do you have 2 parameters for your function isInt(TextField input, String message).
Then you use at first input.getText() and then mesage,
Isn't it better when you only use message and delete TextField input?
+Patrick Pfeiler He mentioned the reason of it in the video. He wanted to show two ways of doing that and in addition you can use them for a bit different purposes. Watch again more carefoully :)
The TextField input parameter gives him a reference to the actual TextField object on the GUI, so he can alter it (change width, height, position, color, text in the field, etc). The String parameters will allow him to use String manipulation as needed, such as splitting, substrings, comparing in RegEx, etc.
Say you wanted the background color of the TextField to turn red/orange if a character is a letter, you would need the TextField object to be passed in to alter the background color.
What is the parsing technique for date? I mean if I have to put a date in a javafx text field, how it will get inserted into the database properly?
bucky, u da best
how do you get the output to display on the GUI instead of the console?
Thank you again!
Why do you need "return true" or "return false". It works without return.
You have to do two things - validate the input and handle the error case. The validation can be performed by the isInt() method, which returns true or false. The error handling should be done somewhere else (since it is not a part of determining if something is actually an Integer) - either directly in the lambda passed to the Button, or in a error handling method. You could also combine the two into a single method like verifyAge() that is called from the Buttons OnClick Event-Handler (this is pretty much what Bucky did, but with better naming).
void/ boolean makes no difference. I am not sure why he would use boolean
I thought I was the only one who was a bit confused
2 years too late to reply now but in this code offcourse it's not needed but it's good to divide your code in small chunks so you can return boolean at the end and depending on the boolean, handle the result outside of the function instead of handling inside isInt(). Depends on your liking :)
Where can I find the code? the github files seems to be outdated.
burst out laughing when he said tuna fish
Hello! If I want to introduce text in the TextField how can i check if what I insert there is a name(string) and not a number or something else? Please help me!
thank you for your comic relief XD
As i know, lambda can only use instance variables or instance objects, why in this video it can access to window and nameInput inside start method?
Has anyone had performance issues with javafx programs. when i resize them it gets laggy and stuttery.
hey ! i was doing the same thing , but I am getting Nullpointer exception when i try to output the text in the text field, i had assigned it an fx: id in scene builder
Try to print "sout" and press Tab. It's magic. =D
yeet majikeee
oh and also try to print psvm and press Tab. thats magic too
thank you!
Nice Video!
how to restrict user to type any character other than number in javafx ?
Where can i get all these source code ?
Hi, thanks to Bucky you can find it on github
github.com/joegaBonito/JavaFX--JAVA-/blob/master/10%20Extract%20and%20Validate%20Input/src/Main.java
How can we show the ouput (result) in the app itself?
u can print the output in a label or smth and add it to the current scene
2late but thnx
I actually did that on a project I had.
function that makes new scene with new parameters for the labels :)
Cool :D
why do you need to pass the string also, you already have it from the input, think it's more intuitive and cleaner. i mean, it's not important, just saying. this tutorial is great by the way
I'm here to learn how to how to get dat data
hey man your videos are really helpfull can you make one when you're working wih database?
lol dont judge me i just had a cough
love your intros
hey bucky, could you pls make some stuff which displays or reads news using JavaFX when we request the computer?
TIL Bacon is not a number