JavaFX Tutorial | Login Screen with database connection (2021)

Поделиться
HTML-код
  • Опубликовано: 29 сен 2024

Комментарии • 80

  • @mailsonalves6945
    @mailsonalves6945 9 месяцев назад +2

    I usually don't comment on videos, but this one deserves, congratulations for this content, very helpful!

  • @BibaBoba2D
    @BibaBoba2D 3 месяца назад +1

    still works in 2024. i wish #tookotek made a validation a changed a scene to the main menu. Basically its a video of establishing db connection and username validation.

  • @mastershonobi110
    @mastershonobi110 Год назад +2

    Hi I am using Java 11 which version of Scene Builder should I use? Currently, I have the latest Version downloaded (19.0) and it does not have the "OnAction" to place the Methods." Should I download the version for Java 8 and use. I am also getting an error "Exception in Application start method." ugh. Thoughts?

    • @tookootek
      @tookootek  Год назад +1

      Hello there! Scene Builder 19 has still have OnAction however please remember that not all objects has OnAction event i.e Button will have it while Label will not. As for Java version / Scenebuilder combination, you can use version that not too far off with each other. There is no universal rule against it except for reasons like potential compatibility issue. As for "Exception in Application start method", can you please check if your fxmlloader have the correct fxml.

    • @mastershonobi110
      @mastershonobi110 Год назад

      @@tookootek I will check and let you know. I am really enjoying your vids. Ty for responding; I appreciate it.

    • @mastershonobi110
      @mastershonobi110 Год назад

      @@tookootek bugs found; 1. I had used a “Label” for instead of “Button” for the “Login” ans “Cancel” buttons and thus that why 1. I could fine the “OnAction” in Scene Builder. Secondly, after correcting my error, I created duplicates of “cancelButton” in login.fxml which max my Application Crash giving me that error message. What a Noob. Great lesson in debugging.

    • @tookootek
      @tookootek  Год назад +1

      @@mastershonobi110 Excellent work! Error is always very much welcome and I personally recommend to work with lots lots of them while they are free. Coding without error is usually good only on production releases but for learning, they are highly recommended whether intentionally done or not. It is part of good learning.

    • @mastershonobi110
      @mastershonobi110 Год назад

      Hi, how do I have the components resize automatic using Scene Builder when I maximize the UI? How can I make it “auto size” when the UI is stretched?

  • @hassnainalidayo5433
    @hassnainalidayo5433 2 года назад +1

    Aslam o alaikum sir, Whenever I run program it display error " Access denied for user @ local host ' using password :no" Any solution??

    • @tookootek
      @tookootek  2 года назад

      Hello there my friend. Your code is having issue connecting to your database. Please ensure that the DB account you use is working with your local database.

  • @pinguinpeng
    @pinguinpeng Год назад +1

    cannot resolve class "sampleController"
    edit: its fixed was a small issue but now its telling me it cannot find symbol isBlank()

    • @tookootek
      @tookootek  Год назад

      Do you have a method or variable variable named isBlank? If it is a method, ensure you got the name right however if it is variable, ensure it was declared.

    • @pinguinpeng
      @pinguinpeng Год назад

      @@tookootek i used isempty instead it works but ill try to fix it thank you im trying to setup the database rn amazing video btw.

  • @draganbjelica9013
    @draganbjelica9013 3 года назад +1

    I did everything but my main class just won't run the window I made in scene builder? It just shows an empty window from the beggining. Maybe I need to update something? I'm using NetBeans 12.0

    • @tookootek
      @tookootek  3 года назад +1

      Hey there Dragan, the main class should atleast have below. Ensure that your "login.fxml" is using the corresponding controller, you can check that in the FMXL or Scene Builder.
      ...
      public void start(Stage primaryStage) throws Exception{
      Parent root = FXMLLoader.load(getClass().getResource("login.fxml"));
      primaryStage.setTitle("Hello World");
      primaryStage.setScene(new Scene(root, 520, 400));
      primaryStage.show();
      }

  • @flickdorion794
    @flickdorion794 2 года назад +1

    Dude you copied the other guy on youtube with exact same video

    • @tookootek
      @tookootek  2 года назад

      Thanks man for giving me a clue, I will let YT copyright management handle that. There are couple of them that copied my videos by trimming the start and end however YT algorithm is too smart to fall for that.
      By the way this login screen has another version. Either you saw the first version or the one that was copied and re-uploaded by someone.
      Happy Learning!

    • @angilstech
      @angilstech 2 года назад

      Check on this, you can share ruclips.net/video/QsTOAXAtdrM/видео.html

    • @computer_science10
      @computer_science10 10 месяцев назад

      Who cares. Sharing is caring

  • @alucard4702
    @alucard4702 3 года назад

    Plugin 'org.apache.maven.plugins:maven-compiler-plugin:3.8.1' not found
    how to fix it?

  • @ilfanza9679
    @ilfanza9679 Год назад

    bro are u komang saputra?

  • @JohnRehill
    @JohnRehill Год назад +1

    I don't seem to be getting the correct result from my 'String verifyLogin' statement. When I run the query directly, I get a correct result of 1 but when I do it in the I get 0, even though I've validated the connection by having the table details printed to console.

    • @tookootek
      @tookootek  Год назад

      Hey John are you still having this issue? can you share your String here?

    • @JohnRehill
      @JohnRehill Год назад

      @@tookootek I'm not getting the issue now as I changed my code to be 'String verifyLogin = "SELECT username, password from User";'
      I think the issue was that it was looping through all the logins stored in the database and I hadn't coded it to stop after a successful hit.

    • @tookootek
      @tookootek  Год назад

      @@JohnRehill good job! The thrill of debugging lives on! Keep it up my friend, you are in the right track.

  • @simplebutamazing3613
    @simplebutamazing3613 Год назад +1

    After three days of suffering over this video, I have finally done it. Tysm!

    • @tookootek
      @tookootek  Год назад

      Welcome to coding world! May sometimes frustrating but so rewarding once you've make it work!

  • @DonCrafts1
    @DonCrafts1 2 года назад +1

    Thanks a lot!!! Helped me!

  • @mikaelmahamat5988
    @mikaelmahamat5988 3 года назад +1

    Excellent Teaching method ...Respect

  • @luisdavidmora5868
    @luisdavidmora5868 5 месяцев назад

    Bro, two years later and this video is amazing, thank you

  • @itachicodes2506
    @itachicodes2506 2 года назад

    why cant I see the image? I checked and my fxml file is good and the directories as well

  • @tidusrod9652
    @tidusrod9652 2 года назад +1

    Hi everyone how to differentiate between a user and an admnin when logging in?

    • @tookootek
      @tookootek  2 года назад +1

      Hi Tidus & Rod, You can add sort of "Role" field. One of the simplest is add a new boolean field, i.e isAdmin the value is just between true or false however you can also use string or number type, it totally depends on how many user you have and how much flexible you want it.

    • @tookootek
      @tookootek  2 года назад +1

      Using the "role" field, you can control what level of access the user will have or what functionality will going to be available

    • @tidusrod9652
      @tidusrod9652 2 года назад

      @@tookootek Thank you very very very much, helpfull !!!! :)

  • @Zureveld
    @Zureveld 10 месяцев назад

    does anyone know where to download javaf sdk?

  • @saltysnot
    @saltysnot 2 года назад +1

    Thank for making this video I love how straight to the point you are with your tutorials! Saves me a ton of time!

  • @ankel4346
    @ankel4346 Год назад

    I still get the error at 34:18 along side with this error :"Cannot invoke "java.sql.Connection.createStatement()" because "connectDB" is null" even after i add the jar file (lastes version). what can i do pls

    • @tookootek
      @tookootek  Год назад

      Hi Ankel, check your DatabaseConnection.java specifically check getConnection() method under DatabaseConnection class - the variables, login account and connection string you use. It might be just a a simple typo in one of them. ConnectDB is null error just telling you it got nothing from trying to establish that connection when you call getConnection().

  • @ilfanza9679
    @ilfanza9679 Год назад

    u absolutely komeng

  • @alexyaa5598
    @alexyaa5598 2 года назад

    URI is not registered (Settings | Languages & Frameworks | Schemas and DTDs), how can I solve this ? At the end of part 2.

    • @angilstech
      @angilstech 2 года назад

      Check this if it can help you can as well share link ruclips.net/video/QsTOAXAtdrM/видео.html

  • @kevinllaca
    @kevinllaca Год назад

    Hello bro , just 1 thing, when i run the Select count(1) on sql it displays the 1 but when i put the correct username and password on the little Login window it still says Invalid Login, how do i fix this?

    • @tookootek
      @tookootek  Год назад

      tookootek
      1 second ago
      Hello There Jakuzo! If you just got Invalid Login then this is good, you are able to connect to your DB and Table. The first we can do is try to "Hard Code" the login and password and try to run again. If that works then it means you might just have extra space in between concat either in Username or Password. You can revert back to username and password TextFields once you resolve the issue. Let me know, there are couple of things we can check what went wrong.

  • @samusnews
    @samusnews Год назад

    Thank for do this amazing video, i learn some concepts today and all worked fine to my project. now i will assist more video that u created. sorry for my inglish, i just a brazilian trying to do something cool, and keep going with your videos.

    • @tookootek
      @tookootek  Год назад +1

      You are welcome! Keep on coding!

  • @kinomyyard
    @kinomyyard 2 года назад

    This is very fast , I can't understand what you are doing 👎

    • @angilstech
      @angilstech 2 года назад

      Check on this, you can share if you love it ruclips.net/video/QsTOAXAtdrM/видео.html

  • @UltramateSL
    @UltramateSL 6 месяцев назад

    Thank you

  • @CindyHyunPH
    @CindyHyunPH 3 года назад

    Nice tutorial

  • @eoghanfeighery7383
    @eoghanfeighery7383 Год назад

    What are the maven ide plugins that you recommend for this?

    • @tookootek
      @tookootek  Год назад

      Hello there Eoghan, IntelliJ IDEA is a good start for JavaFX using Maven, I don't have one yet but I am pretty sure there are coupe of videos that already tackle this. It should give you a good start

  • @SypEX-vz3ui
    @SypEX-vz3ui 3 года назад

    at the end when i click login i get following error:
    SQLException: Access denied for user 'whatever'@'localhost'

    • @tookootek
      @tookootek  3 года назад +1

      Hello S K! In the DatabaseConnection class, have you filled out the Username and password? if you did, please try to login directly to your database if you get the same error.
      Getting Access Denied error is excellent, it means you are halfway to successfully connecting. You were able to setup the correct connection string, you just need to have a proper account.

    • @SypEX-vz3ui
      @SypEX-vz3ui 3 года назад

      @@tookootek i found the mistake. i added a new user to the table UserAccount and tried to login with it. Then i used my root account and it worked!

  • @PurpleSweetObsessions
    @PurpleSweetObsessions 3 года назад

    Watching with my hubby.. This reminds me of my collage days, learning vb6

    • @tookootek
      @tookootek  3 года назад +1

      Love to hear that!

  • @phongmachan3509
    @phongmachan3509 3 года назад

    can you tutorial about hibernate ?

  • @genrescope
    @genrescope 3 года назад

    PLEASE MAKE A TUTORIAL ON HOW TO DISPLAY CONTENT FROM DATABASE IN TABLE VIEW(JAVAFX) 😭😭😭

    • @tookootek
      @tookootek  3 года назад +1

      Hey bro! thanks for watching my video, it is in the works but not sure when I can complete and upload it as there is one or two videos ahead of it. But i am hoping soon.

    • @khlifazeidane3750
      @khlifazeidane3750 Год назад

      @@tookootek please do a video about how to print a bill information on javafx with scene builder please i didn't find any tutorial on youtube about it

  • @botheredspinx7947
    @botheredspinx7947 Год назад

    ERES UN GRANDEEEEEEEEEE, LIKE Y SUB

  • @gilbertcabigasalmazan3289
    @gilbertcabigasalmazan3289 2 года назад

    How to make it so that when its. resized to full screen the components stays on middle of anchor pane?

  • @mightyboshy
    @mightyboshy Год назад

    Do you know how to automatically close the log in window after a successful log in?

    • @tookootek
      @tookootek  Год назад

      Try to add something like this in the Log in button.
      Stage stage = (stage) logInButton.getScene().getWindow();
      stage.close();

    • @mightyboshy
      @mightyboshy Год назад

      ​@@tookootek But it closes without validating the username or account, so if I hit the login button it automatically closes even though the account is incorrect

    • @mightyboshy
      @mightyboshy Год назад

      Nevermind I fixed it, thanks by the way!

  • @sahlofolina4444
    @sahlofolina4444 Год назад

    thanks a lot!!! helped me with my assignment and exam.

  • @karlamariafelix6566
    @karlamariafelix6566 3 года назад

    Came here from a question I had from other of your videos. Thank you so much it helped me to notice my error. Amazing videos!!

    • @tookootek
      @tookootek  3 года назад +1

      You're Welcome! Thanks Karla. Enjoy and keep on coding!

  • @aa_maruf
    @aa_maruf Год назад

    21:20

  • @eduardaalves2272
    @eduardaalves2272 3 года назад

    Thank you very much for your help!

  • @wakura02
    @wakura02 2 года назад

    Thanks you for the great lesson ☺️ I can with a question and I need help from you and others following through. What can cause my login UI to freeze and stops responding afterwards and when I kill the the process am getting this error message in my intellij idea terminal:
    process finished with exit code -805306369 (0x0fffffff)
    What can cause this error thanks for the help

  • @hamzaomari7052
    @hamzaomari7052 2 года назад

    Thank you so much sir. You really helped me so much on doing this. Thank you again sir!

  • @gauravavhad9549
    @gauravavhad9549 2 года назад

    aai baapane nashta nahi dila ka re