Sir I respect you so much, I'm doing my assignment from yesterday, I didn't enter my username and password for the database (I'm so dumb)and I couldn't find it then I realised it now I received Congratulations in login page I'm so happy, the world is in a better place when we have people like you!!!
Thank you and Congrats! Coding is like that, we learned from our mistakes and grow from it. This is the best time for you to welcome those errors and mistakes, they teach you valuable lessons as they are still free.
My friends, search for your life purpose, why are we here?? I advise you to watch this series 👇 as a beginning to know the purpose of your existence in this life. ua-cam.com/play/PLPqH38Ki1fy3EB-8xmShVqpbQw99Do2B-.html
Thanks Marco, appreciate your feedback. That is so true and I already tried to address this on my recent videos but I still keep on looking for new ways of improving new videos.
My friends, search for your life purpose, why are we here?? I advise you to watch this series 👇 as a beginning to know the purpose of your existence in this life.. ua-cam.com/play/PLPqH38Ki1fy3EB-8xmShVqpbQw99Do2B-.html
My friends, search for your life purpose, why are we here?? I advise you to watch this series 👇 as a beginning to know the purpose of your existence in this life.. ua-cam.com/play/PLPqH38Ki1fy3EB-8xmShVqpbQw99Do2B-.html
My friends, search for your life purpose, why are we here?? I advise you to watch this series 👇 as a beginning to know the purpose of your existence in this life.. ua-cam.com/play/PLPqH38Ki1fy3EB-8xmShVqpbQw99Do2B-.html
Hello there sir!thanks a lot for this video it reallty helps a lot !! But i have again a problem, i've read all the comments below but couldn't find the anwer yet. my problem is Error occurred during initialization of boot layer java.lang.module.FindException: Module Project not found the program finishes without opening the application
Add your module in your case "Project " into the folder where your VM options path directs to then add this code into your module-info.java class opens (your package name) to javafx.fxml exports (your package name)
My friends, search for your life purpose, why are we here?? I advise you to watch this series 👇 as a beginning to know the purpose of your existence in this life. ua-cam.com/play/PLPqH38Ki1fy3EB-8xmShVqpbQw99Do2B-.html
My friends, search for your life purpose, why are we here?? I advise you to watch this series 👇 as a beginning to know the purpose of your existence in this life. ua-cam.com/play/PLPqH38Ki1fy3EB-8xmShVqpbQw99Do2B-.html
Awesome! and really appreciate your feedback! That's true actually as this was my earlier videos and bit experimental and looking for a good mixture. Good to hear it help though.
My friends, search for your life purpose, why are we here?? I advise you to watch this series 👇 as a beginning to know the purpose of your existence in this life. ua-cam.com/play/PLPqH38Ki1fy3EB-8xmShVqpbQw99Do2B-.html
This tutorial is so interesting! but I´m having trouble with the loginButtonOnAction. It says that its never used and when I run the program it doesn't show me the loginMessage label like in the video.
Hi Karla! The loginButtonOnAction needs to be assigned back in Scene Builder under Login button OnAction. Something like this ua-cam.com/video/J0IE5LRyzx8/v-deo.html I think I only shown a similar assignment which is for cancel button.
My friends, search for your life purpose, why are we here?? I advise you to watch this series 👇 as a beginning to know the purpose of your existence in this life. ua-cam.com/play/PLPqH38Ki1fy3EB-8xmShVqpbQw99Do2B-.html
My friends, search for your life purpose, why are we here?? I advise you to watch this series 👇 as a beginning to know the purpose of your existence in this life. ua-cam.com/play/PLPqH38Ki1fy3EB-8xmShVqpbQw99Do2B-.html
My friends, search for your life purpose, why are we here?? I advise you to watch this series 👇 as a beginning to know the purpose of your existence in this life. ua-cam.com/play/PLPqH38Ki1fy3EB-8xmShVqpbQw99Do2B-.html
Hi, man. Congratz for your work. I have a doubt. How did you manage to have the TextField and the Button with a custom style. I have only managed to use the Modena style which is by default. I would appreciate if you could tell me what to do to have custom elements like the ones shown in the video. Greetings.
Hi tookootek! Thanks for this video. It's really helping me out. I'm getting an error at the module-info.java section. I get the following error: "Error occurred during initialization of boot layer java.lang.module.FindException: Module LoginFX not found" My file/project name is LoginFX. the module is located in the SRC folder and my package name is loginApplication. My structure is as follows: LoginFX >.idea >images >out >src >loginApplication >module-info.java >LoginFX.iml any idea what might be going on? Also, I'm having an issue with the requires mysql.connector.java line as well. But for now it's commented out. Thanks for you help.
Hey Anthony! Thanks for visiting. Well first and foremost when learning a new programming language, we should welcome and encourage errors. Error are the most demanding teacher that pushes our brain. Anyhow, please check if you did save the module-info.java inside >src folder. If you do, can you do me a favor by deleting it and create a new one from IDE, right click >src folder and click New. See if the error still persist then we check other possible cause. Base on the error message it simply telling us that i cannot find the actual module. Normally this is either of difference in the name or declared location.
@@tookootek Thank you for your response and suggestion. I did go ahead and delete the module and re-create it, making sure it's in the src folder. Unfortunately, it still throws an error 'Module LoginFX not found'. I'm wondering if this is related to project structure or module path? I'm not too sure how all this stuff works yet. I tried googling info about modules and the path and where it should be located.
Hey @@AnthonyAV-ul6kq how things? do you still have the issue? What IDE are you using right now? Based on the folder structure you provided they seems in order so this may leave us with configuration on your VM that may need to be set on the exact path where your project folder is. I have not defined mine as it work by default but if there is any need to specifically set it, we can try that. Are you using IntelliJ or different IDE?
@@tookootek Hello. Yes, still have the same error. I even started all over and re-created the entire project. No luck. I also agree it's related to the VM options. I'm using intellij as well. I am not too familiar with the idea of CLASS PATH vs MODULE PATH's and all that. Currently my VM options are as follows: --module-path /home/anthony/javafx-sdk-14.0.1/lib --add-modules javafx.controls,javafx.fxml I am on Linux by the way. Thanks again for your help.
Hi @@AnthonyAV-ul6kq , I was not able to reproduce the same error as yours so I checked what works with others on Linux system. Can you try this instead. --module-path /home/anthony/javafx-sdk-14.0.1/lib --add-modules=javafx.controls,javafx.fxml It may not work at your end but worth a try. I just re-use your path but added the missing '='. Keep on!
Hey man, great work. I'm trying to follow your tutorial but intellij doesn't recognize mysql.connector.java. Any help? Any libraries i should download? I already have mysql and mysql workbench
My friends, search for your life purpose, why are we here?? I advise you to watch this series 👇 as a beginning to know the purpose of your existence in this life. ua-cam.com/play/PLPqH38Ki1fy3EB-8xmShVqpbQw99Do2B-.html
@@jiiroreor2922 To those who doest know how to edit class path, here is how: 1. File -> Project Structure -> Modules -> Dependencies. 2. Click the + button on the top left side. 3. Select JARs od Directories. 4. Select your .jar file ("C:\Program Files (x86)\MySQL\Connector J 8.0\mysql-connector-java-8.0.28.jar") 5. Apply -> ok. 6. Now you are saved. (ps. If you doesn't have the jar file, it means you did not downloaded it, so you need to download it :) _________to download just search it__________ )
Hey Man, you've created module-info.java in src, but in my IntelliJ, there's no part to create a module, there's only package-info.java, can you help me with that?
17:37 sir when i run the main class it doesn't show any login window it just show in the terminal that successfully finished can you please help me with this i am making my project
if i try to to set the imageView of lockImage and brandingImage when i run the program the images will be not displayed, instead without do anything it works fine. why?
Hey Ragavan! We are using fixed size Window in this Design. You may use the code @Timeline - 18:31 "primaryStage.InitStyle(StageStyle.UNDERCORATED)" to address that. However if you would like to pursue Dynamic size, it requires couple of design and code tweaks depending on what you want to achieve. For example, if you want your Pane to adjust the size to fit the Window then just simply set it as "Fit To Parents".
My friends, search for your life purpose, why are we here?? I advise you to watch this series 👇 as a beginning to know the purpose of your existence in this life. ua-cam.com/play/PLPqH38Ki1fy3EB-8xmShVqpbQw99Do2B-.html
My friends, search for your life purpose, why are we here?? I advise you to watch this series 👇 as a beginning to know the purpose of your existence in this life. ua-cam.com/play/PLPqH38Ki1fy3EB-8xmShVqpbQw99Do2B-.html
Hello Eoghan, the code will work, the difference will be in your IDE plugins for Gradle or Maven but if you set and config what is needed then it should work as-is. I believe openjfx.io have a short doc/notes about this two.
great video, BUT please speak louder and clearer, that munbling is not helping. Besides, music is cool but a little bit lower would help to understand you.
Hi tookootek! Firstly, thanks for the tutorial! It is really helpful, but currently I'm struggling with the error "java.lang.module.FindException: Module loginPage not found". loginPage is simply my app name. I've installed MySQL connector, but it's not working, but when I remove the module-info.java directory from app, it works. Do you know whats the issue? Thanks :)
Yes me and my two other friends got this same error. It would be really helpful if we can find a solution cuz we have been working on this error for hours now thank you!
Hello Klaudia! Hope things alright back there, May I know what JavaFX version you are using? You are using Window OS right? have you added any in VM options or change path of Project Compiler output anyhow?
@@tookootek HI! Apparently I was using macos and somehow it worked, but for my friends with Windows didn't. We did it over and over again, I think their is sth wrong with the path.. but which and where? We are using JavaFX 16, and yes we added VM options and we didn't change the path to Project Compiler. It ends with "out". Thank you! Do you have maybe an email so we could send you some screenshots? cheers!
@@klaudiawojcieska8735 Add your module in your case "loginPage " into the folder where your VM options path directs to then add this code into your module-info.java class opens (your package name) to javafx.fxml exports (your package name)
i still confused, my codes showed error that "mysql.connector.java" module is not found. I try installing the mysql Connector/J from mySQL installer but the error is still there.
No problem, we can resolve it. Typically what we need is just to 1. download mysql connector 2. Unzip the downloaded file 3. in IntelliJ IDEA Go To File > Project Structure > Modules then here click "+" to Add then in the Dialog Window, proceed to where you unzip the mysql connection jar file and select that. That should take care of the issue. If you already done this steps, then let me know what error you encounter.
Great! Thanks for dropping by. Yes the codes will be the same, the difference will be on IDE specific settings and configurations, it should not be much.
hello maybe some can help me and explain me why when i try to use the validateLogin() function like in the 31 min its not founding this func and how i can fix it ?
Hi! Your tutorial is really nice, but my database connection doesn't work and I have no idea why. If I put the username and the password I entered in the scheme on mySQL the app shows me "Invalid login...." rather than "Congratulations!" Any idea? Thank you!
Thanks Carlotta.Can you please clarify where are you getting this error, was it during connecting to database or when login in the Login screen? if it is only in login screen then start with Hardcoding the username and password, if it work then go back to username and password value assignment. it might be just simply an issue either in username textfield assignment or value i.e extra space etc.. let me know. Thanks.
My friends, search for your life purpose, why are we here?? I advise you to watch this series 👇 as a beginning to know the purpose of your existence in this life. ua-cam.com/play/PLPqH38Ki1fy3EB-8xmShVqpbQw99Do2B-.html
My friends, search for your life purpose, why are we here?? I advise you to watch this series 👇 as a beginning to know the purpose of your existence in this life.. ua-cam.com/play/PLPqH38Ki1fy3EB-8xmShVqpbQw99Do2B-.html
Great tutorial so far thanks! I'm a beginner in Java and I'm getting an error within the fxml file. After I selected the name of the 'cancelButton' method inside scene builder's 'On Action' menu, when I go back to the fxml file in intellij the (onAction="#cancelButtonOnAction") is underlined in red and the error message says that it expects a class or interface. I also notice the sole method in the LoginController class doesn't become highlighted. Any ideas?
@Takeya Mitchell, thanks for watching, as for the error, can you please check if your method "cancelButtonOnAction" is present in the controller with exact name. The controller name should match what you specify in the fxml as well.
@@miller01 good question. In FXML you set the "fx:controller", you assign the actual controller you want to use. for example fx:controller="tracingapp.PatientController", in this case, you have a package called "tracingapp" and controller named "PatientController" which you want to associate with your fxml. under "PatientController" you can annotate the FXML objects you want to use i.e Label, Buttons and etc. As for your error, it normally occurs when you specify a method in OnAction that does not exist. Try to copy paste the method name from the controller if that resolve it.
@@tookootek i did copy the exact method name and pasted into the onAction, but it still did not work, i will try the fx:controller tho and will let you know if it worked tomorrow.
@@tookootek alright i added this in the fxml file: fx:controller="sample.LoginController" and it worked, but you did not have this in your fxml, how did it work with you?
My friends, search for your life purpose, why are we here?? I advise you to watch this series 👇 as a beginning to know the purpose of your existence in this life. ua-cam.com/play/PLPqH38Ki1fy3EB-8xmShVqpbQw99Do2B-.html
Error occurred during initialization of boot layer java.lang.module.FindException: Module Billing.System not found what is the reason ( in video 17:39)
This tutorial is great so far, I'm having an issue that I can't find a solution to: Error occurred during initialization of boot layer java.lang.module.FindException: Module format not recognized: C:\Program Files\Java\javafx-sdk-11.0.2\lib\src.zip
Hi @Mondo, thanks for watching. have you already tried setting any VM options? if not in IntelliJ, please Go To main menu > Run > Edit Configurations... then in VM Options use this "--module-path "C:\Program Files\Java\javafx-sdk-11.0.2\lib\" --add-modules=javafx.controls,javafx.graphics,javafx.fxml" however please check if this is where your javafx located else just change the path accordingly. Please try and let me know. Thanks.
@@tookootek I've done just that, now it gives me a different error: Error occurred during initialization of boot layer java.lang.module.FindException: Module javafx.base not found
Hi @@mondofps, just add the javafx.base as well. "--module-path "C:\Program Files\Java\javafx-sdk-11.0.2\lib\" --add-modules=javafx.controls,javafx.graphics,javafx.fxml, javafx.base"
@@tookootek hi, I followed the steps in your comment, but it keeps giving me a error that the module (name) doesnt exist. The (name) stands for the module name on the 1st line of the module-info.java file
I'm not getting an error, but after making a SQLite database, the interactions do nothing. I installed the SQLite jar and have import java.sql.Connection; import java.sql.DriverManager; on DatabaseConnection.java. But I don't know what the problem is. Is it the string url?
Hey there my friend! Here are the things we need. In SQLite Side : 1. SQLite Jar (You already downloaded) 2. Create Database (You already created) 3. Create Table with Fields? In JavaFX IDE 1. You created Connection class? If yes 2. Then in your url set it something like this - String url = jdbc:sqlite:/Users/Core/sqlite/poc.db if you are using windows, then just change the path where you save your sqlite db 3. Put System.out.println("Connected") after the connection URL line, so you will know if you have connected to SQLite successfully first Then run it, you should see first that you were able to connect before you proceed to Querying a table. if you are able to connect, then it become pretty standard after that, similar to what we use in the login video You will have your Connection, Statement, and Resultset Try it out and let me know.
My friends, search for your life purpose, why are we here?? I advise you to watch this series 👇 as a beginning to know the purpose of your existence in this life. ua-cam.com/play/PLPqH38Ki1fy3EB-8xmShVqpbQw99Do2B-.html
hello sir, i have a problem, the code can run but after me insert username, password and click login button my code gone error java.lang.ClassNotFoundException: com.mysql.cj.jdbc.Driver at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:606) at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:168) at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522) and etc. can you help me about that. sorry my english is bad, i hope you understand
Hi Sar Rai, From time to time we get this error in the connection, can you please check again the declaration of the connectDB if they were interchanged. Some of them are closely named. This error is telling us that it is getting null value instead of the expected database connection. trace it back to the DatabaseConnection class. Let me know if it persist. Thanks again.
My friends, search for your life purpose, why are we here?? I advise you to watch this series 👇 as a beginning to know the purpose of your existence in this life. ua-cam.com/play/PLPqH38Ki1fy3EB-8xmShVqpbQw99Do2B-.html
"Module mysql.connector.java not found, required by MyProject" it giving me this error any idea why it might be? i tried to add different version of mysql connectors nothing seems to work... :c
Thanks for trying my video. As for the error, please go to Main Menu > File > Project Structure > Project Settings >Modules > Dependencies then click '+' add your mysql jar from the folder or location you put it. Let me know if it work now
Hi PC Hound! Those JavaFX specific / related code will not work but the rest should be, for example the JDBC should work as-is as it is still Java. However the code needed to be tailored to be Java only and remove any JavaFX related objects i.e annotations etc. The code I have here relies heavily on IntelliJ IDEA, JavaFX modularity and Scene Builder.For example if it will be re-coded without Scene Builder in Java then you need to include a class, methods, or portion of the code just to handle the GUI part and so on and so forth.
Please Help --------> Error : Access denied for user 'demo'@'localhost' (using password: YES) When I enter random name or password I will get above error. Furthemore even though I entered the username and password I filled in MySQL table I get the same error. can someone tell me what I need to do.
Hey man just want to establish this first. 1. You need to have a database connection, a valid user that you use to login to your MySQL database. 2. The username and password you have for your table (usable only for your application) is different from a database user i.e root, administrator...
Okay. I've managed to almost get everything finished, but I get an invalid login message, whether I enter the right username & password or not. On the upside, it detects if the text boxes are empty.
Cool! It means you got connected to sqlite, you just need to figure out the login validation. Start with your SQL query, how did you set your SQL statement? Did you concat it with textbox value? If you don't mind, please share it here and let's see
Need help with module-info.java Hi guys, everything goes well until I added the module (new module) I get this error below. I tried to figure out but need your advice. I named my module JavaLogin. When I compiled, I get this : Error occurred during initialization of boot layer java.lang.module.FindException: Module JavaLogin not found Process finished with exit code 1 here's my module-info.java module JavaLogin { requires javafx.graphics; requires javafx.fxml; requires java.sql; requires javafx.controls; requires mysql.connector.java; opens sample; }
Hi Ge Liang Zhu thanks for the request but I am currently tied up with Agile and Python. I may not be able to create one soon enough for your need. Though I truly believe you can find other resource to help you start out. Goodluck and hopefully you visit again. Thanks.
Hey there my friend! yes you can use it, you just need to take do and take note of the following: SDK: You need to download and add the SQLite JAR, the same way you add MySQL SDK's in the Project Structure > Modules > Dependencies Connection: Change the details in DatabaseConnection.java, you will need to replace the URL with SQLite specific connection string. You don't need the DB user account here SQL Statements: The good news is that we only use simple SQL Statements which are universal and no changes needed. User Account Table You just need to create the table using the same Table Structure/Definition
@@tookootek I'm not getting an error, but after making a SQLite database, the interactions do nothing. I installed the SQLite jar and have import java.sql.Connection; import java.sql.DriverManager; on DatabaseConnection.java. But I don't know what the problem is. Is it the string url?
in IntelliJ is ok, and I run on command line Error mysql driver. How to add mysql driver C:\java14>java --module-path "c:\javafx-sdk14\lib" --add-modules javafx.controls,javafx.fxml,javafx.graphics -jar java14.jar java.lang.ClassNotFoundException: com.mysql.cj.jdbc.Driver
Surely do. Did you set any VM Options? anyway please check File > Project Structure > Project compiler output, what do you see in the path? does it end with "/out"? then check Modules > Path, did you change anything there? is it using Inherit or you specify your own paths? then go to Run > Edit Configurations... do you have any entry or add VM? please share and let's go over it. This error simply telling you that it cannot find the module file it expect in the location you specify
personally I had to switch to intellij 2020, and I liked using module-info.java and inputing the statements needed as opposed to setting VM options (having both set would not let it run)
You may check the 2nd part of this topic at around 16:40 ua-cam.com/video/pf7-zMCQlIc/v-deo.html it shows how I call Register Screen after logging in. Let me know if that is what you are looking for.
I get the following error Caused by: java.lang.NullPointerException: Cannot invoke "javafx.scene.image.ImageView.setImage(javafx.scene.image.Image)" because "this.brandingImageView" is null at login2/sample.LoginController.initialize(LoginController.java:33) Why is my ImageView null?
hello i have a problem connecting the database my problem is java.sql.SQLException: Access denied for user 'root'@'localhost' (using password: YES) can someone pls help me (ive created my database on mysql and not on mysql workbench) im using Eclipse btw
Hey @Yavor, you use the same root account to login to your MySQL instance? Can you share here your Database connection, just remove the account, just want to see what approach you choose to connect to MySQL
Tookotek i need help i am getting the error in module-info. Java not found its inside the src folder and i have the connector file also the error is poping out every time Error occurred during intialization of boot layer Java. Lang. Module. FindExeption:Module test1 not found Test 1 is my package and package name
Hi Alex, thanks for watching my video. Your error is similar to @Anthony AV1611 (couple of comments down below) , he did put his module outside the src folder and it works for him. Can you try that first? If it persist let me know and let's go through it and try couple of things.
Hi @Alex Tennyson can you please try this as well, let's see in Intellij IDEA Go to > File > Project Structure... > Project Settings > Modules then here go to > Dependencies tab. can you see your javafx.base library? if not then you need to add it. In the Tab pane bottom, you will see a '+' sign. Click that and add your Libraries and select javafx.base. It should address the error. Normally when you create a new project and javafx.base library is not set, you will encounter this error even while adding or creating your module-info.
@@tookootek sir i dont know but i tried everything and it was giving me the error then at last i deleted the module folder sir can u please explain why we are using it as my project is working fine as yours .. But thatnx for the answer
for the people that are having problems with the module-info.java, I use java 8 because my uni requires it and so I didn't have the JavaFX SDK downloaded. Once downloaded you can go to file, project structure, +, and then select lib in the SDK file you downloaded and unzipped. Also my project language level was on 8 and it needs to be at least on level 9 for it to implement modules, for this go to project structire and then to Project
Great! @Con Gaming, you need to create the module-info.java, in the Project Tool, select Package Name and right click > New > Module-info.java then inside it, you specify the requires i.e Requires javafx.graphics , javafx.control, javafx.fxml and put Opens "package name". Are you just missing module-info.java or you are getting, module-info.java not found error?
@@tookootek there is no module-info.java when I right click new. However I tried going to project structure then set Project language level to 9 modules is now in the option but I get errors upon typing this Requires javafx.graphics , javafx.control, javafx.fxml
@@kacperdileva8255 yea, i had to use java 8 for college. This step certainly is important in this tutorial. You can still use sql but with a different tutorial, some steps are different
This tutorial is helpful but honestly, it would be 10x better with a few things. 1 - turn the music down. 2 - Please enunciate your words. The whole video sounds like I'm eavesdropping on someone who is talking under their breath to themselves. It makes it hard to hear what you are saying ... add in the music and I honestly just gave up on the video.
Appreciate the honest feedback my friend. It was one of the first video I have uploaded and no excuses here, it is what you say. I tried to improve on the succeeding videos as much as I can. Still thanks for giving it a try.
@@chuksbruno5268 hey bro do you still have this issue? I was out of town, anyway can you please confirm if you have downloaded the mysql connector, if so then in Intellij IDEA Go to > File > Project Structure... > Platform Settings > Global Libraries then check listed items under Sources. Do you see mysql connector there?
@@tookootek THANKS FOR the response i have been able to get that done but i am faced with another error: "Error occurred during initialization of boot layer java.lang.module.FindException: Module Login.Project not found" please help
getting the error Error occurred during initialization of boot layer java.lang.module.FindException: Module Schoolsys not found -schoolsys is my project name - tried placing the module info both inside and outside src, same error - my VM is --module-path "C:\Program Files\Java\javafx-sdk-11.0.2\lib" --add-modules javafx.controls,javafx.fxml
Hi mho ali - Are you using IntelliJ? Before you start applying other solutions, let's start from the common cause. In Intellij IDEA Go to > File > Project Structure... > Project Settings > Modules then here go to > Dependencies tab. can you see your javafx.base library? if not then you need to add it. In the Tab pane bottom, you will see a '+' sign. Click that and add your Libraries and select javafx.base. It should address the error. Normally when you create a new project and javafx.base library is not set, you will encounter this error even while adding or creating your module-info. Let me know if the error persist.
anyone can help me i have problem with ```requires mysql.connector.java;``` it said module not found "requires mysql.connector.java;" i'm using mac thanks in advance
Hey there my friend. "SELECT name FROM sqlite_master WHERE...." should be "SELECT count(name) FROM sqlite_master WHERE". You need to use a COUNT function and it will return an integer value depending on the number of rows hence you need to change your "if (queryResult.getInt(1) == 1){" to "if (queryResult.getInt(1) > 0){" It means that if you have 1 or more return rows from your table then it will count as True. "== 1" will only work if you have one return row
Basically base on the SQL query provided, you want to count the number of records/rows that matches your WHERE condition. The queryResult.getInt(1) is technically your "name" field and it can also be coded as queryResult.getString("name"). (Edit) The condition can also be coded ">= 1 " (Greater or equal 1) because, you will only have a TRUE if there is at least one return row. var login = "SELECT count(name) FROM sqlite_master WHERE type ='table' AND name NOT LIKE 'sqlite_%';"; try{ Statement statement = connectDb.createStatement();
@@tookootek i using Java 8 jdk 11 and it doesnt have module info.java on library. But i really like your tutorial. I suggest you when you upload another tutorial please note in the description about system' you using or version.. Thanks bro
@@roghibashfahani15 Awesome! and appreciate the feedback. You can create Module-info.java by right-clicking in the package and then include all the requires. graphics, fxml and controls. You mentioned that you are getting error in controller file, may i know the exact error?
thanks for this tutorial! it helped me with building a GUI for a database.
Hi Mauro Rodriguez, thanks, good job! Enjoy coding. Happy to know the video helps.
What Really Happened in Afghanistan, The Untold Story 👇
ua-cam.com/video/JKQF-Iic3kI/v-deo.html
Sir I respect you so much, I'm doing my assignment from yesterday, I didn't enter my username and password for the database (I'm so dumb)and I couldn't find it then I realised it now I received Congratulations in login page I'm so happy, the world is in a better place when we have people like you!!!
Thank you and Congrats! Coding is like that, we learned from our mistakes and grow from it. This is the best time for you to welcome those errors and mistakes, they teach you valuable lessons as they are still free.
Esta me ajudando bastante a entender melhor a sistemática da linguagem Java e Scene Builder. Obrigado!
best javaFx tutorial on youtube by far
My friends, search for your life purpose, why are we here?? I advise you to watch this series 👇 as a beginning to know the purpose of your existence in this life.
ua-cam.com/play/PLPqH38Ki1fy3EB-8xmShVqpbQw99Do2B-.html
Truly thankful! Friendly reminder: try tu adjust your voice volume so we can follow what you're doing on screen much easier. Great work anyways! Peace
Thanks Marco, appreciate your feedback. That is so true and I already tried to address this on my recent videos but I still keep on looking for new ways of improving new videos.
My friends, search for your life purpose, why are we here?? I advise you to watch this series 👇 as a beginning to know the purpose of your existence in this life..
ua-cam.com/play/PLPqH38Ki1fy3EB-8xmShVqpbQw99Do2B-.html
Very nice demo. This demo helps me a lot. Very appreciated.
Jean-François Trudel Thanks for the kind words!
My friends, search for your life purpose, why are we here?? I advise you to watch this series 👇 as a beginning to know the purpose of your existence in this life..
ua-cam.com/play/PLPqH38Ki1fy3EB-8xmShVqpbQw99Do2B-.html
You're a lifesaver! Awesome tutorial!
My friends, search for your life purpose, why are we here?? I advise you to watch this series 👇 as a beginning to know the purpose of your existence in this life..
ua-cam.com/play/PLPqH38Ki1fy3EB-8xmShVqpbQw99Do2B-.html
Hello there sir!thanks a lot for this video it reallty helps a lot !! But i have again a problem, i've read all the comments below but couldn't find the anwer yet.
my problem is
Error occurred during initialization of boot layer
java.lang.module.FindException: Module Project not found
the program finishes without opening the application
I have the same error
@@MusicLoverBestsongs yea, me too!
Add your module in your case "Project " into the folder where your VM options path directs to then add this code
into your module-info.java class
opens (your package name) to javafx.fxml
exports (your package name)
My friends, search for your life purpose, why are we here?? I advise you to watch this series 👇 as a beginning to know the purpose of your existence in this life.
ua-cam.com/play/PLPqH38Ki1fy3EB-8xmShVqpbQw99Do2B-.html
It would be great if you can share the code alongside.....Thanks for the tutorial.
Nice tutorial! i can't make database connection though. looking forward to part 2.
He Vincent van der Struis - Thank you! What error are you getting? Let me know.
Hey Vincent! Just incase you are interested, Part 2 is now available
This video is so valuable. Thank you very much 🙏🙏
you deserve 5M followers
More content on JavaFx
Subscribed just for this content of java fx
My friends, search for your life purpose, why are we here?? I advise you to watch this series 👇 as a beginning to know the purpose of your existence in this life.
ua-cam.com/play/PLPqH38Ki1fy3EB-8xmShVqpbQw99Do2B-.html
Thanks, great tutorial, I did find the background music a bit louder than necessary though
Awesome! and really appreciate your feedback! That's true actually as this was my earlier videos and bit experimental and looking for a good mixture. Good to hear it help though.
My friends, search for your life purpose, why are we here?? I advise you to watch this series 👇 as a beginning to know the purpose of your existence in this life.
ua-cam.com/play/PLPqH38Ki1fy3EB-8xmShVqpbQw99Do2B-.html
Hi, thank you for the video. Can I ask you where I can get the code?
hi, you are handsome :)
Hi tookootek! your tutorial is great. Btw, I have a quick question, which part of the implementation that you style the stage to be borderless?
Hi Hao! Thanks for the kind words, by the way it is at 18:33, we set Stage initstyle StageStyle Undecorated.
This tutorial is so interesting! but I´m having trouble with the loginButtonOnAction. It says that its never used and when I run the program it doesn't show me the loginMessage label like in the video.
Hi Karla! The loginButtonOnAction needs to be assigned back in Scene Builder under Login button OnAction. Something like this ua-cam.com/video/J0IE5LRyzx8/v-deo.html
I think I only shown a similar assignment which is for cancel button.
@@tookootek I understand and I'll do that, thank you so much for answering!
Can you please attach resources (photos, etc...) you have used in your tutorial.
Anyhow you have done a great work.
Thank you
Thanks @sermad SAAD, appreciate it. I will make sure I have an available public repository next time.
My friends, search for your life purpose, why are we here?? I advise you to watch this series 👇 as a beginning to know the purpose of your existence in this life.
ua-cam.com/play/PLPqH38Ki1fy3EB-8xmShVqpbQw99Do2B-.html
Amazing tutorial, i just setup all in Manjaro and follow your instructions and everything is perfect, Thanks. +1 and sub
My friends, search for your life purpose, why are we here?? I advise you to watch this series 👇 as a beginning to know the purpose of your existence in this life.
ua-cam.com/play/PLPqH38Ki1fy3EB-8xmShVqpbQw99Do2B-.html
Nice video tutorial my friend and so good background music I did like it :)
My friends, search for your life purpose, why are we here?? I advise you to watch this series 👇 as a beginning to know the purpose of your existence in this life.
ua-cam.com/play/PLPqH38Ki1fy3EB-8xmShVqpbQw99Do2B-.html
Hi, man. Congratz for your work. I have a doubt. How did you manage to have the TextField and the Button with a custom style. I have only managed to use the Modena style which is by default. I would appreciate if you could tell me what to do to have custom elements like the ones shown in the video. Greetings.
Awesome! I used Preview > Themes > Gluon Mobile Light Theme
Hi tookootek! Thanks for this video. It's really helping me out.
I'm getting an error at the module-info.java section. I get the following error:
"Error occurred during initialization of boot layer
java.lang.module.FindException: Module LoginFX not found"
My file/project name is LoginFX. the module is located in the SRC folder and my package name is loginApplication.
My structure is as follows:
LoginFX
>.idea
>images
>out
>src
>loginApplication
>module-info.java
>LoginFX.iml
any idea what might be going on?
Also, I'm having an issue with the requires mysql.connector.java line as well. But for now it's commented out.
Thanks for you help.
Hey Anthony! Thanks for visiting. Well first and foremost when learning a new programming language, we should welcome and encourage errors. Error are the most demanding teacher that pushes our brain.
Anyhow, please check if you did save the module-info.java inside >src folder. If you do, can you do me a favor by deleting it and create a new one from IDE, right click >src folder and click New. See if the error still persist then we check other possible cause. Base on the error message it simply telling us that i cannot find the actual module. Normally this is either of difference in the name or declared location.
@@tookootek Thank you for your response and suggestion. I did go ahead and delete the module and re-create it, making sure it's in the src folder. Unfortunately, it still throws an error 'Module LoginFX not found'.
I'm wondering if this is related to project structure or module path? I'm not too sure how all this stuff works yet. I tried googling info about modules and the path and where it should be located.
Hey @@AnthonyAV-ul6kq how things? do you still have the issue? What IDE are you using right now? Based on the folder structure you provided they seems in order so this may leave us with configuration on your VM that may need to be set on the exact path where your project folder is. I have not defined mine as it work by default but if there is any need to specifically set it, we can try that. Are you using IntelliJ or different IDE?
@@tookootek Hello. Yes, still have the same error. I even started all over and re-created the entire project. No luck. I also agree it's related to the VM options. I'm using intellij as well. I am not too familiar with the idea of CLASS PATH vs MODULE PATH's and all that. Currently my VM options are as follows:
--module-path /home/anthony/javafx-sdk-14.0.1/lib --add-modules javafx.controls,javafx.fxml
I am on Linux by the way. Thanks again for your help.
Hi @@AnthonyAV-ul6kq , I was not able to reproduce the same error as yours so I checked what works with others on Linux system. Can you try this instead.
--module-path /home/anthony/javafx-sdk-14.0.1/lib --add-modules=javafx.controls,javafx.fxml
It may not work at your end but worth a try. I just re-use your path but added the missing '='. Keep on!
Hey man, great work. I'm trying to follow your tutorial but intellij doesn't recognize mysql.connector.java. Any help? Any libraries i should download? I already have mysql and mysql workbench
Jk it's fixed now, just dl'd the connector jar file and then added it to classpath
Thanks Jiiro! Kudos on resolving it. Every error we got is another chance for us to learn new things. Feel free to share what you got anytime.
My friends, search for your life purpose, why are we here?? I advise you to watch this series 👇 as a beginning to know the purpose of your existence in this life.
ua-cam.com/play/PLPqH38Ki1fy3EB-8xmShVqpbQw99Do2B-.html
@@jiiroreor2922 To those who doest know how to edit class path, here is how:
1. File -> Project Structure -> Modules -> Dependencies.
2. Click the + button on the top left side.
3. Select JARs od Directories.
4. Select your .jar file ("C:\Program Files (x86)\MySQL\Connector J 8.0\mysql-connector-java-8.0.28.jar")
5. Apply -> ok.
6. Now you are saved.
(ps. If you doesn't have the jar file, it means you did not downloaded it, so you need to download it :) _________to download just search it__________ )
Thank for video, how to find images in video key word image for GUI login ???
Hey Man, you've created module-info.java in src, but in my IntelliJ, there's no part to create a module, there's only package-info.java, can you help me with that?
Hey man, can you check back if you choose Java instead of JavaFX, module-info.java is available for javafx.
17:37 sir when i run the main class it doesn't show any login window it just show in the terminal that successfully finished can you please help me with this i am making my project
thanks for tutorial can you please provide code too on any website please
Nice
Keep it up
Thanks Ganesh
Thanks, You really helped me a lot
Does the sql db file get compiled in a project jar?
the tutorials is very helpful but the background is not clear for me as a beginner, please next time try to improve the brightness .
if i try to to set the imageView of lockImage and brandingImage when i run the program the images will be not displayed, instead without do anything it works fine. why?
sir when I maximize the window all components get misaligned, what to do sir?. Thanks in advance.
Hey Ragavan! We are using fixed size Window in this Design. You may use the code @Timeline - 18:31 "primaryStage.InitStyle(StageStyle.UNDERCORATED)" to address that. However if you would like to pursue Dynamic size, it requires couple of design and code tweaks depending on what you want to achieve. For example, if you want your Pane to adjust the size to fit the Window then just simply set it as "Fit To Parents".
My friends, search for your life purpose, why are we here?? I advise you to watch this series 👇 as a beginning to know the purpose of your existence in this life.
ua-cam.com/play/PLPqH38Ki1fy3EB-8xmShVqpbQw99Do2B-.html
Thanks a ton bro, your tutorial was Amazing
You're welcome!
My friends, search for your life purpose, why are we here?? I advise you to watch this series 👇 as a beginning to know the purpose of your existence in this life.
ua-cam.com/play/PLPqH38Ki1fy3EB-8xmShVqpbQw99Do2B-.html
For the application does it work in Gradle or Maven?
Hello Eoghan, the code will work, the difference will be in your IDE plugins for Gradle or Maven but if you set and config what is needed then it should work as-is. I believe openjfx.io have a short doc/notes about this two.
once i add the module, Running does nothing unless i delete it
Nice
great video, BUT please speak louder and clearer, that munbling is not helping. Besides, music is cool but a little bit lower would help to understand you.
Hi tookootek!
Firstly, thanks for the tutorial! It is really helpful, but currently I'm struggling with the error "java.lang.module.FindException: Module loginPage not found". loginPage is simply my app name.
I've installed MySQL connector, but it's not working, but when I remove the module-info.java directory from app, it works.
Do you know whats the issue? Thanks :)
Can I send you somewhere a screenshots of app? cheers
Yes me and my two other friends got this same error. It would be really helpful if we can find a solution cuz we have been working on this error for hours now thank you!
Hello Klaudia! Hope things alright back there, May I know what JavaFX version you are using? You are using Window OS right? have you added any in VM options or change path of Project Compiler output anyhow?
@@tookootek HI! Apparently I was using macos and somehow it worked, but for my friends with Windows didn't.
We did it over and over again, I think their is sth wrong with the path.. but which and where? We are using JavaFX 16, and yes we added VM options and we didn't change the path to Project Compiler.
It ends with "out".
Thank you!
Do you have maybe an email so we could send you some screenshots? cheers!
@@klaudiawojcieska8735 Add your module in your case "loginPage " into the folder where your VM options path directs to then add this code
into your module-info.java class
opens (your package name) to javafx.fxml
exports (your package name)
i still confused, my codes showed error that "mysql.connector.java" module is not found. I try installing the mysql Connector/J from mySQL installer but the error is still there.
No problem, we can resolve it. Typically what we need is just to 1. download mysql connector 2. Unzip the downloaded file 3. in IntelliJ IDEA Go To File > Project Structure > Modules then here click "+" to Add then in the Dialog Window, proceed to where you unzip the mysql connection jar file and select that. That should take care of the issue.
If you already done this steps, then let me know what error you encounter.
hey i am getting error as module not found for java.sql and java.mysql even if i have connected java jdk 21 and connector and mysql
If I use eclipse It would be the same right?
And Thx for tutorial
Great! Thanks for dropping by. Yes the codes will be the same, the difference will be on IDE specific settings and configurations, it should not be much.
@@tookootek Ok, Thank you a lot
@@yarazuhd8113 Awesome!
hello maybe some can help me and explain me why when i try to use the validateLogin() function like in the 31 min its not founding this func and how i can fix it ?
Hi! Your tutorial is really nice, but my database connection doesn't work and I have no idea why. If I put the username and the password I entered in the scheme on mySQL the app shows me "Invalid login...." rather than "Congratulations!" Any idea? Thank you!
Thanks Carlotta.Can you please clarify where are you getting this error, was it during connecting to database or when login in the Login screen? if it is only in login screen then start with Hardcoding the username and password, if it work then go back to username and password value assignment. it might be just simply an issue either in username textfield assignment or value i.e extra space etc.. let me know. Thanks.
very nice tutorial
My friends, search for your life purpose, why are we here?? I advise you to watch this series 👇 as a beginning to know the purpose of your existence in this life.
ua-cam.com/play/PLPqH38Ki1fy3EB-8xmShVqpbQw99Do2B-.html
Hello, is this code in github? also thanks for the tutorial.
Hi Valu, Thanks for visiting. It is not available in Github yet.
@@tookootek how about now? Did you upload it on Github?:)
simply amazing
My friends, search for your life purpose, why are we here?? I advise you to watch this series 👇 as a beginning to know the purpose of your existence in this life..
ua-cam.com/play/PLPqH38Ki1fy3EB-8xmShVqpbQw99Do2B-.html
Great tutorial so far thanks! I'm a beginner in Java and I'm getting an error within the fxml file. After I selected the name of the 'cancelButton' method inside scene builder's 'On Action' menu, when I go back to the fxml file in intellij the (onAction="#cancelButtonOnAction") is underlined in red and the error message says that it expects a class or interface. I also notice the sole method in the LoginController class doesn't become highlighted. Any ideas?
@Takeya Mitchell, thanks for watching, as for the error, can you please check if your method "cancelButtonOnAction" is present in the controller with exact name. The controller name should match what you specify in the fxml as well.
@@tookootek yeah i did, but it still doesnt work, how should the fxml file even know which controller it should use tho?
@@miller01 good question. In FXML you set the "fx:controller", you assign the actual controller you want to use. for example fx:controller="tracingapp.PatientController", in this case, you have a package called "tracingapp" and controller named "PatientController" which you want to associate with your fxml. under "PatientController" you can annotate the FXML objects you want to use i.e Label, Buttons and etc. As for your error, it normally occurs when you specify a method in OnAction that does not exist. Try to copy paste the method name from the controller if that resolve it.
@@tookootek i did copy the exact method name and pasted into the onAction, but it still did not work, i will try the fx:controller tho and will let you know if it worked tomorrow.
@@tookootek alright i added this in the fxml file: fx:controller="sample.LoginController"
and it worked, but you did not have this in your fxml, how did it work with you?
How do you get the textfields to look like that instead of empty white rectangles?
Hi @Jonathan Estrada, thanks for giving my video a chance, my Scene Builder Themes was set to "Gluon Mobile Light"
My friends, search for your life purpose, why are we here?? I advise you to watch this series 👇 as a beginning to know the purpose of your existence in this life.
ua-cam.com/play/PLPqH38Ki1fy3EB-8xmShVqpbQw99Do2B-.html
Error occurred during initialization of boot layer
java.lang.module.FindException: Module Billing.System not found
what is the reason ( in video 17:39)
This tutorial is great so far, I'm having an issue that I can't find a solution to:
Error occurred during initialization of boot layer
java.lang.module.FindException: Module format not recognized: C:\Program Files\Java\javafx-sdk-11.0.2\lib\src.zip
Hi @Mondo, thanks for watching. have you already tried setting any VM options? if not in IntelliJ, please Go To main menu > Run > Edit Configurations... then in VM Options use this
"--module-path "C:\Program Files\Java\javafx-sdk-11.0.2\lib\" --add-modules=javafx.controls,javafx.graphics,javafx.fxml" however please check if this is where your javafx located else just change the path accordingly. Please try and let me know. Thanks.
@@tookootek I've done just that, now it gives me a different error:
Error occurred during initialization of boot layer
java.lang.module.FindException: Module javafx.base not found
Hi @@mondofps, just add the javafx.base as well. "--module-path "C:\Program Files\Java\javafx-sdk-11.0.2\lib\" --add-modules=javafx.controls,javafx.graphics,javafx.fxml, javafx.base"
@@tookootek Perfect, that fixed it. Thank you very much.
@@tookootek hi, I followed the steps in your comment, but it keeps giving me a error that the module (name) doesnt exist. The (name) stands for the module name on the 1st line of the module-info.java file
I'm not getting an error, but after making a SQLite database, the interactions do nothing. I installed the SQLite jar and have
import java.sql.Connection;
import java.sql.DriverManager;
on DatabaseConnection.java.
But I don't know what the problem is. Is it the string url?
Hey there my friend! Here are the things we need.
In SQLite Side :
1. SQLite Jar (You already downloaded)
2. Create Database (You already created)
3. Create Table with Fields?
In JavaFX IDE
1. You created Connection class? If yes
2. Then in your url set it something like this - String url = jdbc:sqlite:/Users/Core/sqlite/poc.db
if you are using windows, then just change the path where you save your sqlite db
3. Put System.out.println("Connected") after the connection URL line, so you will know if you have connected to SQLite successfully first
Then run it, you should see first that you were able to connect before you proceed to Querying a table.
if you are able to connect, then it become pretty standard after that, similar to what we use in the login video
You will have your Connection, Statement, and Resultset
Try it out and let me know.
subscribed 😀😀👍👍👍👍
Where are you using validateLogin method ? Mine shows grey color in controller ((
Hello Adik, You may check @40:35 - It is under loginButtonOnAction method
@@tookootek validateLogin method is called under loginButtonOnAction
great vid! when is part two dropping?
Thanks Frantic, appreciate it. The part 2 will be coming soon.
Hi FraNtic, Part 2 is now available.
My friends, search for your life purpose, why are we here?? I advise you to watch this series 👇 as a beginning to know the purpose of your existence in this life.
ua-cam.com/play/PLPqH38Ki1fy3EB-8xmShVqpbQw99Do2B-.html
I have the same problem as @anthony. Java.lang.module.Findexception: module packagename not found. Can anyone help?
Solved it.put the Modulo- info.java file in your package folder where src is present. Not inside src folder
@@ImranKhan-bx4be Happy coding!
Btw thanks. This video helped a lot.
@Imran Khan thanks and happy to know that, appreciate it.
hello sir, i have a problem, the code can run but after me insert username, password and click login button my code gone error
java.lang.ClassNotFoundException: com.mysql.cj.jdbc.Driver
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:606)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:168)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
and etc.
can you help me about that.
sorry my english is bad, i hope you understand
Thanks for the tutorial, I'm getting an error where it is saying that connectDB is null and cannot invoke java.sql.Connection.createStatement()
Hi Sar Rai, From time to time we get this error in the connection, can you please check again the declaration of the connectDB if they were interchanged. Some of them are closely named. This error is telling us that it is getting null value instead of the expected database connection. trace it back to the DatabaseConnection class. Let me know if it persist. Thanks again.
My friends, search for your life purpose, why are we here?? I advise you to watch this series 👇 as a beginning to know the purpose of your existence in this life.
ua-cam.com/play/PLPqH38Ki1fy3EB-8xmShVqpbQw99Do2B-.html
@@الإسلامدينالحق-خ5ت B E A N S
"Module mysql.connector.java not found, required by MyProject" it giving me this error any idea why it might be? i tried to add different version of mysql connectors nothing seems to work... :c
Thanks for trying my video. As for the error, please go to Main Menu > File > Project Structure > Project Settings >Modules > Dependencies then click '+' add your mysql jar from the folder or location you put it. Let me know if it work now
Does this work with regular Java?
Hi PC Hound! Those JavaFX specific / related code will not work but the rest should be, for example the JDBC should work as-is as it is still Java. However the code needed to be tailored to be Java only and remove any JavaFX related objects i.e annotations etc. The code I have here relies heavily on IntelliJ IDEA, JavaFX modularity and Scene Builder.For example if it will be re-coded without Scene Builder in Java then you need to include a class, methods, or portion of the code just to handle the GUI part and so on and so forth.
The MySQL.connector is giving an error, I even downloaded MySql, and still nothing, whats wrong?
Hello there Gains, may I know what specific error you are getting?
@@tookootek Hey, the loginMessageLabel notification does not show for me. Also I wanted to connect the login button to a dashboard
@@tookootek for the MySQL connector I fixed that on my own.
I'm getting confused on the driver part for the try at 38:35
Please Help -------->
Error : Access denied for user 'demo'@'localhost' (using password: YES)
When I enter random name or password I will get above error. Furthemore even though I entered the username and password I filled in MySQL table I get the same error.
can someone tell me what I need to do.
Hey man just want to establish this first.
1. You need to have a database connection, a valid user that you use to login to your MySQL database.
2. The username and password you have for your table (usable only for your application) is different from a database user i.e root, administrator...
What do I have to do if I want that my program will open new window after logged In?
Hey there @Radoslaw! Please check 17:09 of this video ua-cam.com/video/pf7-zMCQlIc/v-deo.html - I believe that is what you are looking for
Okay. I've managed to almost get everything finished, but I get an invalid login message, whether I enter the right username & password or not. On the upside, it detects if the text boxes are empty.
Cool! It means you got connected to sqlite, you just need to figure out the login validation. Start with your SQL query, how did you set your SQL statement? Did you concat it with textbox value? If you don't mind, please share it here and let's see
@@tookootek Can I have a Zoom meeting with you? I just need some help please.
@@tookootek package sample;
import javafx.event.ActionEvent;
import javafx.fxml.FXML;
import javafx.fxml.Initializable;
import javafx.scene.control.Button;
import javafx.scene.control.Label;
import javafx.scene.control.PasswordField;
import javafx.scene.control.TextField;
import javafx.scene.image.Image;
import javafx.scene.image.ImageView;
import javafx.stage.Stage;
import java.io.File;
import java.net.URL;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.Statement;
import java.util.ResourceBundle;
public class LoginController implements Initializable {
@FXML
private Button cancelButton;
@FXML
private Label loginMessageLabel;
@FXML
private ImageView brandingImageView;
@FXML
private TextField usernameTextField;
@FXML
private PasswordField enterPasswordField;
@Override
public void initialize(URL url, ResourceBundle resourceBundle){
File brandingFile = new File("Images/manos-amigas.png");
Image brandingImage = new Image(brandingFile.toURI().toString());
brandingImageView.setImage(brandingImage);
}
public void loginButtonOnAction(ActionEvent event){
if (usernameTextField.getText().isBlank() == false && enterPasswordField.getText().isBlank() == false){
loginMessageLabel.setText("Logging in...");
validateLogin();
}else{
loginMessageLabel.setText("Fill both textboxes please");
}
}
public void setCancelButtonOnAction(ActionEvent event){
Stage stage = (Stage) cancelButton.getScene().getWindow();
stage.close();
}
public void validateLogin(){
DatabaseConnection connectNow = new DatabaseConnection();
Connection connectDb = connectNow.getConnection();
//String verifyLogin = "SELECT count(1) FROM user_account WHERE username = '" + usernameTextField.getText() + "' AND password ='" + enterPasswordField.getText() + "'";
var login = "SELECT name FROM sqlite_master WHERE type ='table' AND name NOT LIKE 'sqlite_%';";
try{
Statement statement = connectDb.createStatement();
//ResultSet queryResult = statement.executeQuery(verifyLogin);
ResultSet queryResult = statement.executeQuery(login);
while(queryResult.next()){
if (queryResult.getInt(1) == 1){
loginMessageLabel.setText("Welcome!");
}else{
loginMessageLabel.setText("Invalid login.");
}
}
} catch (Exception e){
e.printStackTrace();
e.getCause();
}
}
}
Need help with module-info.java
Hi guys, everything goes well until I added the module (new module) I get this error below. I tried to figure out but need your advice. I named my module JavaLogin. When I compiled, I get this :
Error occurred during initialization of boot layer
java.lang.module.FindException: Module JavaLogin not found
Process finished with exit code 1
here's my module-info.java
module JavaLogin {
requires javafx.graphics;
requires javafx.fxml;
requires java.sql;
requires javafx.controls;
requires mysql.connector.java;
opens sample;
}
Hy Jean-François Trudel, keep the module file name as module-info.java then have it place/save in the SRC folder, same level with your package.
@@tookootek Thank you very much. Fixed !! Best.
First part completed. We are waiting for the next part ! Best
Hey Jean-François Trudel you got a good progress there my friend. The incoming holiday affecting my schedule but rest assured it will be uploaded.
@@tookootek Finally got it ! working now like it suppose !! my God.. what an adventure Best
request javafx + spring framework + database. tq
Hi Ge Liang Zhu thanks for the request but I am currently tied up with Agile and Python. I may not be able to create one soon enough for your need. Though I truly believe you can find other resource to help you start out. Goodluck and hopefully you visit again. Thanks.
@@tookootek I have succeeded. java14 + javafx11 + spring framework + hibernate + mysql. run on client raspberry. tq
Can I use this with SQLite?
Hey there my friend! yes you can use it, you just need to take do and take note of the following:
SDK:
You need to download and add the SQLite JAR, the same way you add MySQL SDK's in the Project Structure > Modules > Dependencies
Connection:
Change the details in DatabaseConnection.java, you will need to replace the URL with SQLite specific connection string.
You don't need the DB user account here
SQL Statements:
The good news is that we only use simple SQL Statements which are universal and no changes needed.
User Account Table
You just need to create the table using the same Table Structure/Definition
@@tookootek What specific string do I replace in DatabaseConnection.java?
@@tookootek I'm not getting an error, but after making a SQLite database, the interactions do nothing. I installed the SQLite jar and have
import java.sql.Connection;
import java.sql.DriverManager;
on DatabaseConnection.java.
But I don't know what the problem is. Is it the string url?
Parang gusto ko na yata mag withdraw sa pagiging I.T student ko..
in IntelliJ is ok, and I run on command line Error mysql driver. How to add mysql driver
C:\java14>java --module-path "c:\javafx-sdk14\lib" --add-modules javafx.controls,javafx.fxml,javafx.graphics -jar java14.jar
java.lang.ClassNotFoundException: com.mysql.cj.jdbc.Driver
i copy driver mysql to c:\javafx-sdk14\lib. now is run well. tq
@@geliangzhu9136 thanks for watching. Glad to know you have resolved it. Enjoy coding!
So ...
I was trying to get this to work, but my intelliJ cannot get the requires at 17:16, it says " module not found "
Can any one help me on this ?
Surely do. Did you set any VM Options? anyway please check File > Project Structure > Project compiler output, what do you see in the path? does it end with "/out"? then check Modules > Path, did you change anything there? is it using Inherit or you specify your own paths? then go to Run > Edit Configurations... do you have any entry or add VM? please share and let's go over it. This error simply telling you that it cannot find the module file it expect in the location you specify
personally I had to switch to intellij 2020, and I liked using module-info.java and inputing the statements needed as opposed to setting VM options (having both set would not let it run)
module not found: mysql.connector.java. What should I do?
nvm fixed it :)))
@@andreisas1621 kudos!
how can i make a button redirect me to another interf
ace
You may check the 2nd part of this topic at around 16:40 ua-cam.com/video/pf7-zMCQlIc/v-deo.html it shows how I call Register Screen after logging in. Let me know if that is what you are looking for.
I get the following error
Caused by: java.lang.NullPointerException: Cannot invoke "javafx.scene.image.ImageView.setImage(javafx.scene.image.Image)" because "this.brandingImageView" is null
at login2/sample.LoginController.initialize(LoginController.java:33)
Why is my ImageView null?
Hey there my friend, please check in the fxml or Scene Builder if you had assigned a corresponding FX:ID for the ImageView as "brandingImageView"
@@tookootek Worked. Thank you! :)
hello i have a problem connecting the database my problem is java.sql.SQLException: Access denied for user 'root'@'localhost' (using password: YES) can someone pls help me (ive created my database on mysql and not on mysql workbench) im using Eclipse btw
Hey @Yavor, you use the same root account to login to your MySQL instance? Can you share here your Database connection, just remove the account, just want to see what approach you choose to connect to MySQL
Tookotek i need help i am getting the error in module-info. Java not found its inside the src folder and i have the connector file also the error is poping out every time
Error occurred during intialization of boot layer
Java. Lang. Module. FindExeption:Module test1 not found
Test 1 is my package and package name
Hi Alex, thanks for watching my video. Your error is similar to @Anthony AV1611 (couple of comments down below)
, he did put his module outside the src folder and it works for him. Can you try that first? If it persist let me know and let's go through it and try couple of things.
Hi @Alex Tennyson can you please try this as well, let's see in Intellij IDEA Go to > File > Project Structure... > Project Settings > Modules then here go to > Dependencies tab. can you see your javafx.base library? if not then you need to add it. In the Tab pane bottom, you will see a '+' sign. Click that and add your Libraries and select javafx.base. It should address the error. Normally when you create a new project and javafx.base library is not set, you will encounter this error even while adding or creating your module-info.
@@tookootek sir i dont know but i tried everything and it was giving me the error then at last i deleted the module folder sir can u please explain why we are using it as my project is working fine as yours .. But thatnx for the answer
Also sir i was getting error in syntax of sql query so i used preparestatement instead of statement now it working well
@@tookootek sir can you please tell how can i creat click action on label so that if i click on it signup page open
for the people that are having problems with the module-info.java, I use java 8 because my uni requires it and so I didn't have the JavaFX SDK downloaded. Once downloaded you can go to file, project structure, +, and then select lib in the SDK file you downloaded and unzipped. Also my project language level was on 8 and it needs to be at least on level 9 for it to implement modules, for this go to project structire and then to Project
I need help, i can't find module-info.java, any idea how to fix it? thanks
Great! @Con Gaming, you need to create the module-info.java, in the Project Tool, select Package Name and right click > New > Module-info.java then inside it, you specify the requires i.e Requires javafx.graphics , javafx.control, javafx.fxml and put Opens "package name". Are you just missing module-info.java or you are getting, module-info.java not found error?
@@tookootek there is no module-info.java when I right click new. However I tried going to project structure then set Project language level to 9 modules is now in the option but I get errors upon typing this Requires javafx.graphics , javafx.control, javafx.fxml
can u send me the images u used pls
can you give me source code for part 1 and 2 please
Hellow po
literally spend over 3 hours to figure out that "requires java.sql;" isn't available in java 8 :(
Is that step important for creating this project? Because i also have java 8, so i didn't know if i should start this tutorial.
@@kacperdileva8255 yea, i had to use java 8 for college. This step certainly is important in this tutorial. You can still use sql but with a different tutorial, some steps are different
where is the source code?
This tutorial is helpful but honestly, it would be 10x better with a few things. 1 - turn the music down. 2 - Please enunciate your words. The whole video sounds like I'm eavesdropping on someone who is talking under their breath to themselves. It makes it hard to hear what you are saying ... add in the music and I honestly just gave up on the video.
Appreciate the honest feedback my friend. It was one of the first video I have uploaded and no excuses here, it is what you say. I tried to improve on the succeeding videos as much as I can. Still thanks for giving it a try.
Hi почему субтитры не роьят
you are not using most of the helpful features of IntelliJ. No need to import all those files manually. It's simply alt + enter and boom!
Next time try to mumble harder, I almost heard you
java: module not found: mysql.connector.java....I got this error when compiling
please help @tookootek I'm confused here, I'm behind schedule to deliver on a project
@@chuksbruno5268 hey bro do you still have this issue? I was out of town, anyway can you please confirm if you have downloaded the mysql connector, if so then in Intellij IDEA Go to > File > Project Structure... > Platform Settings > Global Libraries then check listed items under Sources. Do you see mysql connector there?
@@tookootek THANKS FOR the response i have been able to get that done but i am faced with another error: "Error occurred during initialization of boot layer
java.lang.module.FindException: Module Login.Project not found"
please help
i took it outside the src folder and it works!!
@@chuksbruno5268 that's great to hear! Enjoy coding my friend.
If you could actually open your mouth and let’s hear what you are saying … that would be very helpful
getting the error Error occurred during initialization of boot layer java.lang.module.FindException: Module Schoolsys not found
-schoolsys is my project name
- tried placing the module info both inside and outside src, same error
- my VM is --module-path "C:\Program Files\Java\javafx-sdk-11.0.2\lib" --add-modules javafx.controls,javafx.fxml
Hi mho ali - Are you using IntelliJ? Before you start applying other solutions, let's start from the common cause. In Intellij IDEA Go to > File > Project Structure... > Project Settings > Modules then here go to > Dependencies tab. can you see your javafx.base library? if not then you need to add it. In the Tab pane bottom, you will see a '+' sign. Click that and add your Libraries and select javafx.base. It should address the error. Normally when you create a new project and javafx.base library is not set, you will encounter this error even while adding or creating your module-info. Let me know if the error persist.
@Madsen Cooper Greatly appreciate your input! thanks
Hi everyone! Any ideas why this error happen and how to fix it? Thanks!
Argument 'getClass().getResource("view/login.fxml")' might be null
i get an error on this line not sure why Class.forName("com.mysql.cj.jdbc.Driver");. can anyone help on this
anyone can help me
i have problem with
```requires mysql.connector.java;```
it said module not found "requires mysql.connector.java;"
i'm using mac
thanks in advance
You need to download the mysql connector then add that mysql connector jar
@@tookootek thank u, i'll try it
Here's my LogController.java
package sample;
import javafx.event.ActionEvent;
import javafx.fxml.FXML;
import javafx.fxml.Initializable;
import javafx.scene.control.Button;
import javafx.scene.control.Label;
import javafx.scene.control.PasswordField;
import javafx.scene.control.TextField;
import javafx.scene.image.Image;
import javafx.scene.image.ImageView;
import javafx.stage.Stage;
import java.io.File;
import java.net.URL;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.Statement;
import java.util.ResourceBundle;
public class LoginController implements Initializable {
@FXML
private Button cancelButton;
@FXML
private Label loginMessageLabel;
@FXML
private ImageView brandingImageView;
@FXML
private TextField usernameTextField;
@FXML
private PasswordField enterPasswordField;
@Override
public void initialize(URL url, ResourceBundle resourceBundle){
File brandingFile = new File("Images/manos-amigas.png");
Image brandingImage = new Image(brandingFile.toURI().toString());
brandingImageView.setImage(brandingImage);
}
public void loginButtonOnAction(ActionEvent event){
if (usernameTextField.getText().isBlank() == false && enterPasswordField.getText().isBlank() == false){
loginMessageLabel.setText("Logging in...");
validateLogin();
}else{
loginMessageLabel.setText("Fill both textboxes please");
}
}
public void setCancelButtonOnAction(ActionEvent event){
Stage stage = (Stage) cancelButton.getScene().getWindow();
stage.close();
}
public void validateLogin(){
DatabaseConnection connectNow = new DatabaseConnection();
Connection connectDb = connectNow.getConnection();
//String verifyLogin = "SELECT count(1) FROM user_account WHERE username = '" + usernameTextField.getText() + "' AND password ='" + enterPasswordField.getText() + "'";
var login = "SELECT name FROM sqlite_master WHERE type ='table' AND name NOT LIKE 'sqlite_%';";
try{
Statement statement = connectDb.createStatement();
//ResultSet queryResult = statement.executeQuery(verifyLogin);
ResultSet queryResult = statement.executeQuery(login);
while(queryResult.next()){
if (queryResult.getInt(1) == 1){
loginMessageLabel.setText("Welcome!");
}else{
loginMessageLabel.setText("Invalid login.");
}
}
} catch (Exception e){
e.printStackTrace();
e.getCause();
}
}
}
Hey there my friend.
"SELECT name FROM sqlite_master WHERE...." should be "SELECT count(name) FROM sqlite_master WHERE". You need to use a COUNT function and it will return an integer value depending on the number of rows hence you need to change your "if (queryResult.getInt(1) == 1){" to "if (queryResult.getInt(1) > 0){"
It means that if you have 1 or more return rows from your table then it will count as True. "== 1" will only work if you have one return row
Basically base on the SQL query provided, you want to count the number of records/rows that matches your WHERE condition.
The queryResult.getInt(1) is technically your "name" field and it can also be coded as queryResult.getString("name").
(Edit) The condition can also be coded ">= 1 " (Greater or equal 1) because, you will only have a TRUE if there is at least one return row.
var login = "SELECT count(name) FROM sqlite_master WHERE type ='table' AND name NOT LIKE 'sqlite_%';";
try{
Statement statement = connectDb.createStatement();
ResultSet queryResult = statement.executeQuery(login);
while(queryResult.next()){
if (queryResult.getInt(1) >= 1){
loginMessageLabel.setText("Welcome!");
}else{
loginMessageLabel.setText("Invalid login.");
}
}
I don't have module-info.java. and when i try to making a module-info.java then i've got error in controller file
Hey there Roghib! How things? Do you still have the error? Can you please share and let's figure it out
@@tookootek i using Java 8 jdk 11 and it doesnt have module info.java on library. But i really like your tutorial. I suggest you when you upload another tutorial please note in the description about system' you using or version..
Thanks bro
@@tookootek same issue as mine
@@roghibashfahani15 Awesome! and appreciate the feedback. You can create Module-info.java by right-clicking in the package and then include all the requires. graphics, fxml and controls. You mentioned that you are getting error in controller file, may i know the exact error?
@@tookootek it need to install Java 9.
"Java: warning: source release 9 required target release 1.9"
i don't find new "module-info" in intellij, what is the problem !!!!!!!!!!??
Hi Rami did you specify JavaFX Application as your project type?
@@tookootek yes i do