JavaFX Java GUI Tutorial - 10 - Extract and Validate Input

Поділитися
Вставка
  • Опубліковано 10 жов 2024
  • Source Code: github.com/the...
    Core Deployment Guide (AWS): docs.google.co...

КОМЕНТАРІ • 58

  • @JonnieZuramski
    @JonnieZuramski 9 років тому +53

    sup bucky love you m8 these tutorials are getting me through college lol

    • @108everest
      @108everest 8 років тому +9

      +Jonnie Z Says a lot about the current education system.

    • @JonnieZuramski
      @JonnieZuramski 8 років тому +5

      +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

    • @fireflies15
      @fireflies15 5 років тому

      same here

    • @TimoBaader
      @TimoBaader 5 років тому +2

      @@JonnieZuramski try microdosing mushrooms (not even joking)

    • @skytwohigh8721
      @skytwohigh8721 4 роки тому

      @@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

  • @hinrikkonnecker7077
    @hinrikkonnecker7077 3 роки тому +1

    Without your tutorials I would have killed myself by now

  • @francisemv1788
    @francisemv1788 5 років тому +1

    at the end, home boy is like, aight, i'mma head out n get some lean

  • @pyram66
    @pyram66 8 років тому +3

    For some reason I thought "my age is tuna fish" was really funny. Have a like! :)

  • @cesarpauloalves3844
    @cesarpauloalves3844 7 років тому +1

    Are you the guy from "Casually Explained"?? haha your voice just looks like his.. Your tuts rock ;)

  • @apostolis6725
    @apostolis6725 3 роки тому

    Very useful video for so practical issues! Thanks a lot :)

  • @SenseiEli
    @SenseiEli 4 роки тому

    This voice in 2020! They would quarantine you! And send you to Covid 19 test!!! hhhhhhhh Lucky 2015 !!

  • @SenseiEli
    @SenseiEli 4 роки тому

    Thank you again!

  • @shashwatkhanna6036
    @shashwatkhanna6036 9 років тому +4

    Bucky, Dont Worry! We know you don't Smoke!

  • @patrickpfeiler3449
    @patrickpfeiler3449 9 років тому +8

    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?

    • @TheAdas0
      @TheAdas0 8 років тому +2

      +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 :)

    • @andrewhughes459
      @andrewhughes459 7 років тому +4

      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.

  • @jewelleharper6285
    @jewelleharper6285 8 років тому

    His voice is darn adorable!

  • @errerogdfgdf
    @errerogdfgdf 6 років тому +1

    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 ...

  • @rafaelangelopiad2320
    @rafaelangelopiad2320 4 роки тому

    bucky, u da best

  • @yashchaudhari7558
    @yashchaudhari7558 6 років тому +1

    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?

  • @Mr17slayers
    @Mr17slayers 4 роки тому +1

    burst out laughing when he said tuna fish

  • @kuntahouen3835
    @kuntahouen3835 4 роки тому

    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.

  • @jakubkorsak605
    @jakubkorsak605 9 років тому

    Nice Video!

  • @devdylan6152
    @devdylan6152 4 роки тому

    thank you for your comic relief XD

  • @nicolas267s
    @nicolas267s 8 років тому +3

    Try to print "sout" and press Tab. It's magic. =D

    • @anilmawji
      @anilmawji 7 років тому

      yeet majikeee

    • @NA-is2oo
      @NA-is2oo 7 років тому

      oh and also try to print psvm and press Tab. thats magic too

    • @ilieschamkar6767
      @ilieschamkar6767 5 років тому

      thank you!

  • @markanthonyoccena7345
    @markanthonyoccena7345 3 роки тому +1

    Where can I find the code? the github files seems to be outdated.

  • @gurkansanli1978
    @gurkansanli1978 8 років тому +4

    Why do you need "return true" or "return false". It works without return.

    • @Xehanort94Ger
      @Xehanort94Ger 8 років тому +1

      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).

    • @MrKelvinJane
      @MrKelvinJane 7 років тому +1

      void/ boolean makes no difference. I am not sure why he would use boolean

    • @MrKelvinJane
      @MrKelvinJane 7 років тому +1

      I thought I was the only one who was a bit confused

    • @syedmuhammadoan2039
      @syedmuhammadoan2039 6 років тому +2

      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 :)

  • @ionutcozma6814
    @ionutcozma6814 5 років тому

    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!

  • @aietisenaj6425
    @aietisenaj6425 4 роки тому +1

    how do you get the output to display on the GUI instead of the console?

  • @carlsanc3880
    @carlsanc3880 9 років тому

    My question is, i am trying to learn the best practices, lets say needed to create an object and store said object, who process that request? Is it a good practice to collect information in B and process it in C aswel? Or should i collect it on C, make sure it is good(ex: user entered data within permited range etc) and then pass it to the Main class (A) and have said class create and store the object?

  • @vlada_janjanin
    @vlada_janjanin 7 років тому

    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

  • @Dante3085
    @Dante3085 6 років тому +1

    Has anyone had performance issues with javafx programs. when i resize them it gets laggy and stuttery.

  • @dunginhanh3460
    @dunginhanh3460 7 років тому

    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?

  • @abdessalemkheyar3619
    @abdessalemkheyar3619 4 роки тому

    hey man your videos are really helpfull can you make one when you're working wih database?

  • @vivekrawatvlogs
    @vivekrawatvlogs 8 років тому

    how to restrict user to type any character other than number in javafx ?

  • @addykulkarni
    @addykulkarni 5 років тому

    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

  • @Utshaw
    @Utshaw 8 років тому +1

    Where can i get all these source code ?

    • @aNDy-qh1em
      @aNDy-qh1em 8 років тому

      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

  • @torbjrnbakke5608
    @torbjrnbakke5608 4 роки тому +1

    I'm here to learn how to how to get dat data

  • @kiranpaudel7145
    @kiranpaudel7145 5 років тому

    hey bucky, could you pls make some stuff which displays or reads news using JavaFX when we request the computer?

  • @xrealx369
    @xrealx369 8 років тому

    How can we show the ouput (result) in the app itself?

    • @787vijay
      @787vijay 8 років тому +1

      u can print the output in a label or smth and add it to the current scene

    • @xrealx369
      @xrealx369 8 років тому

      2late but thnx
      I actually did that on a project I had.
      function that makes new scene with new parameters for the labels :)

    • @anilmawji
      @anilmawji 7 років тому

      Cool :D

  • @NA-is2oo
    @NA-is2oo 7 років тому

    lol dont judge me i just had a cough
    love your intros

  • @tjitsekoster9379
    @tjitsekoster9379 5 років тому

    TIL Bacon is not a number