Cafe Management System in java (JFrame, Netbeans, Mysql Database) Complete Project (step by step)

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
everyone welcome to my youtube channel in this video i'm going to show you quick overview on my cafe management system project i am using netbeans id mysql database jframe java so let us start with that so here you can see this one is our first piece that one is our login page so before login we have to sign up so let's move to the signup page and here we have to enter the details one by one so let us start with the first one that's name so god of umar after that we have to enter the email addre disable right now but when we enter all the details it would get enabled so let's write one by one one two three four five six seven eight nine zero this mobile number after that we have to enter the address let's write here india after that we have to enter the password so one two three i'm writing over here and here we have to enter the security question manually i did not added a combo box which is easy to like uh so everyone user have their own security question that's good for security reasons so that's why users have a text field so let me write a security question what is your pet name so i'm just writing here and i'm writing the answer tom so you can see automatically the save button it get enabled so let's uh like the mobile number uh digit should be 10 so let's remove one digit it will get disabled okay let's enable it again so let's check for this email address also you can see it get disabled because we are matching the pattern and we are validating according to that so let's write here com com okay after that when we click on save then it will show that a pop-up message registered successfully wait for admin approval so when we try to log in with our credentials like gaurav at the gmail gmail.com and password123 and we try to log in it will show a message wait for admin approval because the admin did not approve that that's why we are not able to log okay so let's uh check once uh for the forget password we can change it or not so let's write here the email ad address okay gmail.com and for reset the password you need a security answer so we have to enter the email address after that we have to write here the answer so i'm just writing tom one first after that here i'm writing the new password one two three four and you can see the our uh answer is wrong so it should not update incorrect answer is shown to me and when we click on okay it will not affect anything when we delete this and we try to update it again password change successfully it means that our security answer is correct when we click on ok it will delete clear all the fields so it's working fine okay so let's try to log in and let's write here gaurav at three gmail.com and here you uh let's log in with the old password one two three incorrect username or password we are getting a pop-up message if we drive it one two three four and try to log in it will say wait for admin approval because our correct password is one two three four that's why showing that okay so this is all about login sign up and uh how we will uh register for it when we forget the password how we can recover change that password so i already have a uh like id password which we which we are going to use for logins so which already approved so god have added gmail sort of gmail.com and the password is one two three i'm going to login it so here you can see we are able to move to the home page or you can say the dashboard page of our cafe management system project here you can see we have only few controls because it does not have admin access so for admin access we have to enter different credentials so let's see first for the user modules what are the power we give to the user so let's go with the place order so any user any user can play create a build for user or like customers so here you can see this one is our place order page so here we have to enter one by one details for all so let's see first leave this part for customer details part for now and move to the category so here you can see all the products which we have so you can see the category let's save coffee click on coffee and you can see there we have only two like two types of coffee gold and flat white so click on this when we click on this uh raw it will add whatever the details related to that over here and you can see the button previously was also disabled it automatically get enabled and if we increase this by one it will get increment by one if we decrease this one and we try to decrease by more than one so it will not work it should be minimum one quantity okay so if we increase to two three it will increase the total amount also so when we click on add to card it will add it to our cart here you can see that product over here after that let's select some other products like you can see it also get changed so let's chocolate and let's increase this and add to cart okay you can see it's working fine and you can also search the product according to your need so let's say we i want to search the butter so you can see we are able to search it let's read this and let's change this to software i want to search some product which does not exist now here i am searching butter so you can see it will not show any details related to and we have to write the name which we have exist in that table to see that record okay that's why uh we added this search button okay after that you can see the product it added but still generate bill and print bill is not working a button is disabled because we did not enter the customer details and here you can see also the grand total price over here and let's enter all the details here so that you can get it okay so here let's say amit kumar okay and here we have to enter the mobile number of customer to generate the bill okay so after that we have to write the email address of customer you can see when we write the complete email address you can see automatically the bill generate will get enabled so let's read zero so you can see it automatically disable because we are validating or everything over here so now we can generate the bill so let's click on generate bill and predict here you can see also the bill id that's eight just click on generate bill bill details added successfully when we click on ok it will trigger like uh it will trigger and open a pdf which has been generated for this bit from here you can print it whatever you want you can do here you can see the details which we have like a bill id customer name you can see amit mart total amount paid you can see here you can see the name price quantity total everything you can see over here so in this way we are generating the bills for the particular customer and in the same way you can see page gets refreshed you can see the bill id also get changed you can see everything is get replaced according to previous now again we can add these things add these things let's change other things also and try to add it yeah it's working fine okay and we want to change this light so it will also work okay so let's close this and let's move to the view bills and order place details so here you can see the bill which we have generated is visible over here like the raw so this bill was generated right now we generated this bill you can see here total amount which we collected is 1195 and below you can also see click on draw to open that bill if the bill exists in our system we can open it directly on clicking on rom let's click on this bill you can see again it will open that same video from the same location you can see the bill is getting open okay so and you can see also the increment and decrement option is there so you can increment a decrement according to id let's say we have 1000 record we want to check for 1000 id so in that case what you need to do you need to scroll to 1000 or to reach 1000 so in that case you just need to change to this uh descending so it will automatically uh reverse that order id and you can see the all okay after that you like you want to see for like whole month how much sale is there so in that case you just need to delete this part so you can see that uh for the yesterday you can also see the record you can see 0 5 6 2021 you can see the details for also and here you can see also the one more thing here is it created by you can see the build was created with a particular user so i am using right now sorter at the gmail.com id that's why here you can see the created by to this and others views by created by admin amidja sora admin this ids we created these builds so let's say like uh any bill is getting deleted from the particular location in that case what happened when we click on this it will show a masses file is not exist because that bill is get removed and if you are like other thing also if you want to search filter by like your or you want to see the silt report for complete year just need to remove this you can see two top it will show all the uh like uh record for 2020 one okay so according to that you can change it here we write 20 then it will remove all the because we don't have any record for 2020 okay after that close this so this is all about viewed bills and order place details after that we have two more or more options change password change security questions so let's check one by one so after the password is one two three four and here you can see also we have uh like uh validating the button and after that i just want to change it to one two three and one two three when we write one two three you can see uh button get enabled let's say right one four five then it automatically get in uh disable because we are matching this it should be same that's why showing uh like it get disabled okay so let's write here the some wrong password i'm just writing one two three four five and try to update it old password old password is wrong it means that we have to enter the correct password one two three and it's four so i'm just writing one two three one two three and updating this old password okay it's showing uh wrong okay just hold the second so i think one two three is the password okay one two three four i'm just writing okay password change successfully our old password is one two three that's why it's showing the error because uh i think uh gaurav added gmail.com having one two three four password that's why it's showing here okay so let's close this and let's move to the security question so here you can see your security question or what town or city you uh was your full-time job here you can see that uh question security question so i just want to change that question so i'm just writing who was your childhood hero i'm writing this security question question mark after that i'm just writing the uh like answer iron man okay after that i'm just writing the like password which we have right now one two three four okay and i will click on update so it will update this you can see uh it get changed uh what was your childhood here you can see security question get changed if we try to like a wrong randomly question uh random and password sorry wrong password so it will say that password is wrong it will obviously we are entering the wrong password that's why showing that error message so this is all about user module a normal user can do this type of operations uh when admin approved that so let's log out and let's check admin power also so what type of operation admin can perform so there is an admin at the read gmail.com and the password is admin admin can also uh like perform a forget password and other stuff also let's go to the login you can see the dashboard we are using the same dashboard but these buttons are not visible to normal user this buttons are only visible to the admin modules admin this for this user so here we are managing all these things like in this you can see the product and all so we the admin have only power to manage those stuffs so let's uh see one by one we will start with verify user first because we registered with that email address so here you can see we have a uh like god of god up gmail.com you can see the details here you can see the status is false that's why it's showing that a user cannot log in so if you want to change it we just need to click on that particular rom so it it's asking do you want to change the status of god gmail.com so when we click on no it will not affect anything when we click on yes it will change that the status change successfully when we click on ok it will refresh and you can see it get true if we want to disable anyone we just need to click on this and we have to change to yes and it will get false so if we try with the solidwork.gmail.com it will not work if we try with godaddy.gmail.com it will work and we can also filter according to like we want to search particular user and like we have a hundred like uh user who was uh managing these things like generating bills for the customer so if you want to search a particular user so we just need to write the name for particular email address sort of at the gmail.com so it will show that if we search anything which does not exist so it will get blank okay so this is all about verify user now let's move the manage category in manage category we can add the n number of category we want let's say here we are going to write this soup category we are going to add you can see the button is also get validating we are validating it let's click on save category added successfully and when we click on ok you can see it gets refreshed and here you can see the ids 670 is not visible because the i already added this and deleted that that's why it's showing like that so let's click on this do you want to delete the soup category so when you click on yes it will delete it definitely so click on that and category deleted successfully click on ok you can see it get removed let's again add this to okay and click on save category added successfully successfully okay you can see the ninth id it id get changed so this is all about manage category now let's move to the new product so here you can see the new product we have so i just want to add some product so cream shoop okay and i just also want to change to this and here we have to enter the price let's say and you can see the button is also disabled because we did not enter this details so 120 i write it over here and when we click on save it will product edit successfully and if we write something and we want to clear this we just need to clear this okay and this way we are adding the product and now if you want to really delete and update your product so you just need to go click on this and here you can update it so let's say we want to update any product so i just want to update this and i just want to make sure make this to be shoe bean shoe and here you can see the price i also want to change to 100 after that we also want to change this we can also change the category and here you can see one more thing that uh the first option we have that one is our like the category we have you can see this one issue that's why it's going to first option it automatically get to first position so let's click on update product updated successfully when you click on ok you can see being so when we click on this you can see the first option is visible according to this if we click on this you can see the first option is soft ring it's uh uh like first we are setting this and other things are from uh like uh category okay in this way we are maintaining it so let's delete any one product says read this chinese product egg noodles and let's click on delete so it will ask do you want to delete this product when we click on yes it will product deleted successfully so when we click on ok it will delete it you can see you are not able to see that so in this way we are going to manage the product view delete and all so let's check out that uh that product is visible or not so let's move the chinese and you can see we have only two product over here so in this way we are going to handle all the products and the uh the user control admin control and user control you can see over here let's log out and let's try to log in with a goddamn gmail.com got it at the read gmail.com and here i'm just writing the password i think one two three four so it need to work you can see it's working fine because we activated this user and we deactivated that uh sorter at the gmail.com and here the password i think is one two three uh sorry one two three four i think let's try wait for administrator because we disable this user so in this way we are managing all the uh things related to cafe so this is all about cafe management system project and i will also create videos on this so stay tuned with us please hit like and subscribe my channel hello everyone welcome to my youtube channel in the previous video i just show you quick overview on my cafe management system project if you are not seen that video just go to the description and check out the link in this video i'm going to show you sign up part of my cafe management system project so let's start with that let me exit this application and let me create a new project over here so we have to click on file new project after that we have to click on java with end and in that you can see a java application option is there we have to click on next and after that we have to write here capi management system okay after that you can select this option and we have to click on this finish it will create a project it will may take a take one or two seconds to create it after that you can see a project has been created with the name cafe management system project after that we have to create some package for like we are going to use in this so in the source package right click on this and create a java package in this package just write the name so images so we are going to create an image package and after that we have to click on finish and after that we have to create a new package so we are going to create a new package which name is dao data access object so whatever like query and all this stuff we are going to write in the dow package okay after that the next package which we are going to use is like a model okay so we are going to use the generics in this project so we are going to create the model for all okay so you can see model has been created and we are going to create one more package in that we are going to store the pop-up icons so pop up icon okay click on finish so we created these packages okay one by one we are going to use this so first we have to create a page so just jframe form and here we just need to write sign up okay after that we have to click on finish now now we will increase the size of this to one three six six comma seven sixty eight you can see the page size get increases so after that we are going to minimize this and we are going to open this palette and one by one we are going to insert okay so first thing is we have to write sign up okay and we are going to increase the size of this to hold 36 okay bold 36 and we're going to change the color to red okay and let's close this okay it's not completely red okay no problem with that with that after that we have to insert we have to write for name okay after name we have to write here email okay after email address the next or like we have to take it email mobile number mobile number okay after that mobile number the next uh which we need it over here is address okay after address the next option which we have to like we have to take it from user so password okay after password the last second is security question question okay and after that the next one is ansa okay and uh one by one we are going to insert uh like uh fields for them so here the first field we have text field and uh the next for the email address we are also going to use a text field for mobile number we are also going to use text field for address we are also going to use a text field for password we are going to use the password field so after that uh for security question we are also going to use a text field and after that for answer we are also going to use textview okay so let me increase the size little bit so let's make it as 351 okay and let's increase this one also so uh just stretch all these fields to make it as same okay increase one by one okay after that we have to select all these fields and labels and we have to go to the properties and we have to make it as bold 14 which we are going to okay so you can see form has been created after that we have to remove this this uh details also and we are going to change the variable name so for this we are going to write dxt name okay after that we have to change the variable name like txt email okay and we also need to remove the text from this after that we have to change the variable txt y number okay and we also need to remove the text field from this okay remove this text change the variable name txt address okay change the variables txt password okay and we also need to remove this text from here default text okay remove this text change the variable name t txt security question okay and at last we have answer so txt sorry uh we just need to right click on this change variable txt and so okay after that we have to click on ok and save this move little bit down so in the bottom we have to place three buttons over here so let me place it one by one one two and three okay and uh we also need two more buttons over here to like uh for the forget password and login page okay so let me change it our text one by one forgot password question mark okay and in this uh we just need to change it to login login okay and in this uh we just need to change to the save save okay it's size is automatically get changed so let's change this layout to absolute layout okay after that we are going to select this all and we are going to increase the size of this button to making it as bold 14 okay okay so let's select first one edit text right here save okay and in this uh we are going to uh set the icon so okay we don't have any icon right now you can see so first now we have you have to do it just go to the description of this video and you there get the like a link to download these images so in that you will see these things first the images so you need to copy in the images package and after that you have to copy this to the pop-up icon or package and this is the pattern which we are going to match with our like email or for mobile number so you also get uh it from here so let's copy this all image and paste this to like just or paste it to image package paste you can see it's get paste all the images over here okay after that uh like decrease that and move to this place and copy the pop-up icon all these three icons and paste it over here okay you can see now now we need a save icon so just go to the properties and just click on it over here and after that we have to select the image package in that we have save save dot png select that click on ok after that we have to go to the properties again and we have to follow the same steps image after that we have we have to select for the clear you can see clear.png image okay so let me also change the text so let me make it as clear okay after that we have to uh like exit button is there so exit and we also need to change in the we have also need to add the icon so images exit we have to select this exit small okay click on ok close this okay so after that we just need to move a little bit this to the right so it could uh like look exactly as uh okay fit to the screen okay let me change this layout to a free layout so that we can place it correctly okay and let's move a little bit right to this sorry let's get changing the location okay let me change this to move little bit space in this automatically it's changing the location no problem now it gets fixed okay in the similar way you can also change it now let me change this layout to again absolutely out okay let's change save this revert that and save this and close this and open it again and after that when you change the layout it will not uh move to the location to somewhere else absolutely out okay let's check the size one three six six uh seven six uh i think the size is uh one three six six seven sixty eight i think yeah 768 okay and uh after that uh like uh change to the absolute layout okay we've already done with that now now we have to set the image in the background so just place a label go to the properties and just select a like image [Music] and we have to select a image that is uh first page background this one okay after that we have to click on ok close this just place it perfectly to the panel over here okay and just move a little bit down and check every side after that we have to double click on this uh image and you can see the label name is visible over here so we have to press the back space button and after that we have to save this okay so you can see uh the page is visible okay we have to just move a little bit right over here this sign up and let's uh open this in the full screen let me minimize this okay uh now it's looking perfectly as uh like a quick overview okay so one thing we forget over here that we did not remove the like min max close button so to remove that we have to open this you can see the navigator if the navigator option is not there so you uh you can go to the windows and here you can see the navigator option you just need to click on that okay after that you will see these options okay after that you have to go to the j frame go to the properties and you have to just click on this check box and you have to click on close after that just save this page okay after saving this you can see the gui has been created for us now we have to write the code for the like back end so whenever the save button hits it should perform some task so for that we have to create a one way one like few steps we have to do so let's start with that so first we have to create a model as as i already tell you that we are going to use a generics and we are going to use the collection concepts like add a list and other things in this project so first we have to create a java class uh and we have to going to create a user okay user class in this user class we are going to create some variables so private and id private string name okay private string email private string mobile number okay private string address okay after that private string password private string security question okay private string answer and the last one is our status like whenever user law registers or sign up its status is false because uh he did not get approved from admin that's why it should be false initially it should be false okay that's why we are using the status uh okay status okay after writing these variables we need to generate the get resetter so right click on this and insert code you can see this option click on that after that you can see a pop-up mess this one is open so we have to click on generate uh get sorry getter and sector we have to click on getter and set click on that and select for complete class click on this option and click on generate it will generate a greater setter for all the fields you can see it's visible over here so our model has been created now after creating models we have to move to the tab so to create the connection with data database we can we have to create a connection provider class okay so let's create a connection provider class okay and we have to click on finish you can see the class has been created okay after that public static connection type okay connection okay we have to like import import java.sql asterisk okay so after that we will try to import these things maybe it will work okay so before uh like writing anything related to database uh first we need to import a zar file that is our mysql is our file because we are going to use the mysql in this so open this library uh and just go to the google and download mysql sar file and uh check your version of mysql you can see in this we are using mysql version 8.0 so i have to add a zar file according to that so i'm going i already downloaded it so i will likely going to add it add jar just click on that it will open a pop-up and i'm going to the like i'm going to select my mysql you can see mysql connector java you just search with this name you can easily find the that and just click on open you can see it will load over here you can see background scanning of project is going on it will reach 200 percent then you start working so it it added successfully make sure you can see the end is with dot jar otherwise maybe some student added the dot jeff files and asking for error so that's why i'm saying that make sure it's jar okay after that we have to come back over here and we have to import the connection after that we have to write her git con method okay we are going to create a method over here and it should return the connection type off okay so that's why it's showing the error so now let's write her try catch block first okay and in cash blog we are going to write exception e and in this catch block we are going to write g option pan okay that's option is not visible okay g so j should i think uh we are going to return something null over here okay and in the try block actually we have to write we have to create the connection so first thing is we have to load the class class dot fold name okay so first thing is uh we have to write here com dot mysql dot jdbc dot driver okay and after that we have to write here connection type connection con equals to okay and we have to write a driver driver this option when you press ctrl space you will get uh this type of options and like right we write dot over here after that we will press the control space or sometime it will show the pop-up when initial words are already there so get connection and we are going to use this let's minimize this so you can see the complete line at once okay so first thing is we have to write the url so if you are using your on like mysql which you install in your local system then you can use this url okay jdbc mysql mysql okay and local host 3306 in case like someone using some other data like uh online database so here he have to write the ip address of that like open cloud some other database anyone is using so here you have to write the ip address and part number is get changed so he can also change right over here after that we have to write uh slash and database name so till now we did not created any database so we are going to open the mysql database and here we are going to create a database create data base cafe management system cms okay and after that we are moving back here again cms okay after that if you have to write here question mark use ssl equals to false okay this one after that we have to write a root and we have to write a password to three four five six yeah you can also try with without this if for you it will work then it's fine if you're not working then you can write this okay it will not going to cause any issue after that we have to return this connection which we created right now return on okay so you can see uh the error automatically get removed because we write uh like uh we return for both try block as well as catch block so that's why the error gate are resolved okay so that let me match once jdbc driver jdbc mysql localhost 3306 cms you can see and this one is our password this one is our username okay after creating connection we need one more class which in that we are going to like uh perform all the operations but just passing the query so we are going to create a more class uh and we are writing the name for that class is d b sorry db operations of predictions okay after that we have to click on finish it will create a class in this the same way we are going to create a method static method and we're going to make it as wide because we are not going to return anything back to the user uh back to those whoever call this okay so set data or or delete okay we write this method and in this we are taking the two parameter the first one is string which is type of query whatever the query user can pass and the second one is message the user want to display okay after that uh like the next thing is we are going to write the try catch block try catch block exception e okay and in this we are going to use the g option pan to display the errors okay g options okay this is not visible i think we did not import like a java swing that's why once again j option p should be small g option pan dot so message okay dialog okay so it will automatically import i think you can see this one is imported if option is not visible you make sure you import this otherwise it will show the error okay it's showing some kind of figure not to worry about that so delete this first option we have to pass the null and for the second we are going to pass the e so whatever the error is and the third we are going to pass the message the header should be written with the message and it should uh like j option pan okay and uh after writing few later control spacebar to get the suggestions you can press dot error message this option okay let me minimize this okay so in this way we are going to write over here okay after that we have to write in the try block okay so first thing is we have to create the connections so we have to call the connection provider class so connection provider you can see we provide some data and we can press the control and the space bar then we are getting the options okay after that we have to write it on connection okay sorry here we just need to write connection okay and here we just need to write connection provider dot get con okay after that we have to write a statement okay we need to import the like uh import java dot sql or task trick okay statement okay a statement st st equals to con dot create statement after that we have to create press the control space bar control you can see after that we have to execute that query so st dot execute query execute update sorry cute update you can see the string and here we just need to pass that query query okay and we just okay uh it should be capital that's why it's showing it up so you can see we pass the query after that we are also need to display a message whatever is uh we are getting from the user okay and if the user don't want to display message he can pass the blank so we have we are going to check it if the message is not going to be planned then we are going to display that message okay so message message dot equals not equals so measure when message is not equal to this then we are going to display this g option pan dot show message dialog null and you can see automatically taking the message over here so our connection has been created we can perform the operations whatever we want after that uh we have created the for inserting deleting updating whatever the operation we want we can perform with this method we just need to pass the query and other details okay after that we have to create the table in this database use cms right now we don't have any uh tables sorry okay so empty set now we have to create the table so for that we are also going to create a table class so here we are going to write table tables because ed having multiple tables okay after that we have to like uh create a main class so so that we can execute it directly so public is static static void main string or okay and after that we have to write here we can't run this class rightly okay and after we have to write try catch block because we are writing the operations related to uh database that's why we have to suppress the exception let's say we are using strike edge block over here and in this uh we have to write g option pan option pan dot show message okay delete this okay delete this all and just write first null comma e whatever the error it will show this okay so after that we have to create the tables string we are going to create a variable string user table okay equals and intervals we have to write the query so which we want to pass to that okay so let's start with that so create table user id and auto it should be auto increment that's why we are writing after that it should be primary key okay primary key and after that we have to write the name so name where can and it should be 200 so you can change it as your like want okay email where can we also make it as 200 okay after email the next is our mobile number so mobile number where can 200 after mobile number next one is address where cap 200 okay so mobile number should not like it should thin digit okay so we just need to remove this and then and after address the next one is our password password backer let's make it as 200 if any user who wanted make more secure he can use 200 characters so we are just writing okay security question okay where can and here we just need to write 200 and and so answer where can okay uh 200 and the last one we have status where can okay and we are making it as 20 and the last thing is we want like our email address is unique so for that what we need we need to write is unique and in the brackets we have to write email okay let me move a little bit right so that you can see the complete query okay and we have write a create a query that create table user id in auto increment primary key name where can email mobile number address welcome password security question answer status unique email address okay you can see how we write the query it's just a like a string okay so we need to perform the db operation we need to use the db operation okay db operation in that we have embedded set data or delete okay so we are going to call this and we are going to pass the like first at first option we are going to pass the user table and the second option we are going to pass this message so table okay here i'm going to write user table created success fully okay so let's save this and let's taste it once it's working or not so just run this okay uh it will take few seconds uh for first time okay so it's keep loading you can see it's running right now okay we are getting a message user table created successfully it means that our table our database is whatever we done till now it's working fine so click on ok and open the mysql database and here just run the same command you can see we are able to see the user table over here so let me show you the description user you can see we have a unique email address yeah the field should be unique primary key name while number everything you see whatever we write over here okay our table has been created now the next thing is we just need to write the query okay so for that we have to create one more thing over here is class so in that we are going to store all the queries related to user table so let's write a user tao okay so it's a data access object okay after that we are going to write her public static white c and we have to start this okay so whenever we are going to call this method it should it should get some value so that value should be like user type this type of value should be there okay so it should contain these details so what we need to do is we have to get that user so press ctrl space we are not getting any option so we just need to import here import and we have to import the model package so you can see after that pressing ctrl speaks we are able to see the user you have to press enter and press the semi column you can see now again move here press ctrl space bar you can see we are able to import from here after we have to write a small user so whenever this material call it should get the value like this for all the values should be there okay after that we have to extract all the values from this like okay and we have to pass to create like save that details in our database so let's create a query over here so string query okay and here we have to write insert insert into user and just minimize this this one okay and here we just need to write all the fields name in which we want to insert so let's write one by one name email first is id so we don't want to insert any id to it because it automatically incremented okay so name email mobile number okay address after address password after password security question so this name should be exactly same as this one otherwise you will maybe get some error okay answer status okay after that we have to write here values okay it's showing error because we did not place the semi column at the last so let me place it you can see error get removed now the next thing is we need to extract the values from like uh from from this user okay so for that what we need to do is okay so simple doubles we have to play uh display the first okay so user dot and in this way we can get extract the value so get the first thing is we need to insert is get name so get name press enter it will extract that value you can see like this okay so we just need to copy this and please here we going to place the comma paste it one two ah so just count it one two three four five six seven eight okay so we need to paste it six more time one two three four five six okay so let me change it one by one so that you can easily get it so next thing is forget email address okay when we press ctrl space y or to automatically take it if like not much suggestion about that similar words okay so after email address we are going to use for mobile number so you can see we press the control space it automatically take it okay mobile number after mobile number the next one is for address circuit address we have two option with letter a start with so that's why it's asking us so we are going to select for the address after address the next one is for like uh password i know yeah yeah sorry yeah it's for password so we are going to write here user dot get password after that uh we are going to write get uh security question okay after security question the last second is hit answer okay and the last is get status hit status okay so our query has been completed okay you can see the complete query at once okay and after that the next thing is we have to just uh we have to just pass this query to our just me let me open this we just need to pass this query to our this one and it will take care of everything it will save to our database so here we have to write here db operation dot set data this one and we are passing that query and with that we need to pass the message so i'm just writing here registered it will move little bit mouse up okay registered successfully okay wait for admin approval okay okay one more thing i forget over here so like we are not going to pass the status over here because it should be initially it should be false okay so let's remove this uh from here and let's uh paste here false you can directly pass this value okay so now so now we have to just uh pass these details in the when we call this method we just need to pass the user details object of that and we will extract that value from that and we are going to clear save that to our database now again we have to move to the sign up part of sign up page get back to over here and now the first thing is which which we are going to do is we are going to create some variable over here so public here not over here uh here we are going to create it inside the class so public uh string email pattern okay and in equals so in this we just need to copy that pattern which i show to you okay just copy this pattern and paste it over here and after that you have to write a public string and here we just need to write mobile number pattern okay and in the doubles we just need to pass the next pattern okay paste it over here okay after that the first thing is like whenever like this page gets load which this button should be disabled so for that what we need to do is btn dot button okay we did not change the button name i think okay so let's change the variable name just to vt and save okay and we can also change the variable name of this btn and we can see here clear okay and change the variable name to this btn exit okay leave these two buttons because we are going to write for forget password and login so let's move again control space bar button dot and here we have to enable we have to select this and here we just need to write here false okay so it will disable that button okay after that the next thing is we are going to create a method over here so public white clear okay so in this uh like whenever this method will recall it will clear all the fields as well as it will also disable our save button so let's write the code for that so txt name dot set text it should be nothing okay of that text email dot set text and it should be nothing okay txt while number dot set text nothing okay in the same way txt address dot set text okay doubles txt security question dot set text nothing okay after that uh the next is txt uh answer txt and so dot set text i think okay after that the next is txt password dot set text so like whenever click on save button it should clear all the fields that's how we are writing this okay and at last we are also disabling the button so button.c dot set enable and we are again making it as false okay after this like the next thing is like we are going to write the code for this exit application so let's write here end a equals to g option option pan so when you uh we like write this it will automatically import it package you can see java x dot swing g option pan so if you are you have to manually and you can also directly import it okay after that uh we have to write dot show confirm it should be confirm dialog okay after that first we have to write the null uh okay it should be null and here we just need to write do you you really uh want to close the close application we will display this message and here we are going to write select and at last we are giving the options to the user our g option pan dot yes no option we are going to select it okay at last semi column place to next order if a is equal equals to 0 it means that user selected yes so that we have to exit this application system dot exit and here we just write 0 so uh for this command this uh like this will close our gpm so in that case application get set down okay after that uh the next thing is we have to write the code for like save the button okay so let's move to the design and we are going to double click on this c button okay and we are going to create a object of user so i think it will not import it so we have to import it manually so get back to over here and we have to write import and we have a model package so model package user class okay again map get back to that over here after that we have to write user and we are going to create a new object of that our user class okay and in this we are going to sit one by one the values so user dot set name okay in this we are going to set the value with the name so txt dot name dot get text okay so after that user dot set uh email address so txt email dot get text okay in the same way we are going to set all the values so user dot set uh the next one is mobile number so txt mobile number dot get text okay after that user dot sit address and here we have to write pxt address dot get text okay text of that user dot set password and here we have to write txt password dot get text okay this one user dot set we are setting all the values for this class for all the variables so after password the next one is for secured equation security question and txt security question we have dot get text okay uh at last we have user dot set and so and here we just write t x t answer dot get text okay and at last we have to call the user down so we cannot uh like call that midterm over from directly over here we have to call this method right so just close this and we have to import it first so we just need to come over here we have to write import and we have to write the package name dow dot we have multiple options so go to the user down and in this and move it back to over here again and here we just need to write user dao dot save you can see we need to pass the user so we are passing the object of this user class okay over here and this will see okay uh this will execute this query and get all the values from that uh this object and and it will send to other class and it will that will save us okay so let's get back to our sign up page over here and after this we need to clear like uh if any exception anything happen and any case we need to clear all the fields so we created a method over here above that is scalia so we call that you can see this method so we call that so at the end we have to call this okay after that we also need to call this so just double click on this and generate the for this action so failure method we are going to call this for this also okay i think everything is working but till now we did not able to write the code for validation so we are going to write for that so let's start with that okay so we are going to create a method over here so below the clear method move a little bit down public white validate fields okay and in this we are going to this pattern we are going to match the things with pattern and all so let's start with that so we are going to get the value one by one so string name txt name dot get text string email txt okay email dot get text okay string mobile number equals to txt mobile number dot get text okay after that is string uh address okay txt address dot get text okay and the same way we are going to also get the values from others password txt okay password dot get text this one the string okay password security question txt security question dot get text string and so equals to txt answer dot get text okay so now we are going to use if else condition over here so first thing is name dot equals if if it is equal to nothing you can see is blank so in that case we need to disable that button okay so button dot sieve okay so button save dot set okay okay it's not equal to so we have to enable that button so we are making it as true and in this same way we are going to add it and and and here we are to match the pattern so email dot match and here we are passing the email email pattern okay and we have to write a mobile number while number it should also match with while number pattern okay so if it it will not match okay it will not give true then it builds it uh the button does not enable so it should be match okay after that we have to also check that uh the mobile number length should be 10 so for that we also need to write mobile number dot length uh is equal equals to is equal equals to 10 it should be 10 okay after that and and we are going to check that address at this dot equals it should not like this and and and password dot equals it should not like this okay and and and after that we have to secure the question so security question dot equals it should not like this and and the last we have answer dot equals okay dot equals should not like this okay so you can see the complete if condition we have email dot match model number should be like a pattern while number link should be 10 address password security question it should be not equal to this okay after that in else condition we are going to disable this button okay so ptn save dot set enable enable false so in else condition if this condition are not satisfied then button does not enable okay so you can see that we till now we did not call this method so we also need to call this okay so let's move to over here and we have to generate the events for all so we are going to generate even for key released one by one we are going to generate event for all this field so event he released okay he released and uh the next is for the address event he released and for the password event he released okay and for security question event he released and the last is for event address sorry answer okay so you can see the event has been generated so now let me write here validate fields this one okay and we are going to copy this exactly same to others events okay okay next one for address for password for security questions and at last we have answer okay after that we just need to save this okay let's close all these things which we did tell now and we are going to just open this page open this and when we try to run click on this and try to run it from there over here it will not work so for that we just need to go to the properties and we have to click on run and we have to browse the login uh okay so right now we have sign up page so we are not going to like start from sign up page it should be start from login page so we will do it uh later so let us start it from over here so just right click on click on run pi okay so it will execute okay you can see our c button is disabled right now so god of okay so caller kumar okay email address gmail.com it's just a dummy email address two three four five six seven eight eight nine zero i'm just writing india password i'm just writing one two three security question i'm writing what is your pet name question mark i'm just writing here top okay you can see the save button it get enabled so let's test it it's working fine or not you can see it get disabled okay let me delete this com it should get disabled yeah it's working fine let's read this storm okay it's working fine let's read this copy this you can see it disabled okay so uh let me click on save button you can see we get a pop-up message register successfully wait for admin approval it means that we are able to create all the things which is related to sign up part successfully when we click on ok it should clear all these fields and it should also disable the save button so let's test it let's click on okay you can see the save button is get disabled let's uh check once we try to write anything in this okay and try to clear this it should work so this is all about sign up part of my cafe management system project i hope you guys like this video so please hit like and subscribe my channel thank you hello everyone welcome to my youtube channel in the previous video i just show you sign up part of my catherine management system project if you are not seen that video just go to the description and check out the link in this video i'm going to write the code for login part so let us start with that let me exit this application and let me create here a new jframe page so here i'm just writing login and click on finish okay after that we have to create uh increase the sizes to 1366 comma 768 and it will according to my screen size that's why increases to this one okay after that uh what we need to do is we have to like insert the labels for the login okay so just open the palette and we have to insert a label over here and here we have to write the login login and after that we have to make it as old hold 36 okay and here the color code which we are going to use it is 2 0 4 2 0 4 okay and we have to close this okay after that here we have to insert few other things like uh email address we have to write for the email okay and another level we need over here that one is for password okay password and for that we have to one uh we need over here one is text field and another one is password field okay so let me place it over here ah let me increase the size of this little bit so let's make it as uh 350 one okay and let me increase this to also 351 okay after that we have to insert some buttons over here so let's insert one by one so it should be like uh it should login and it should have a icon so we have to click on this and here we have to select this image and here we have to go for the login dot png image after that okay and let's insert another button over here at the center of this yes it is this sorry you read this color and here we have to select another icon for this so just select this okay we have to select it from image package and we have to select clear dot png image okay after that we need here one more button uh that button is for like exit the application i'm just writing exit and here we have to insert the icons so again we are going to select this image and exit so exit a small icon we are going to select it okay after that we have to insert two more buttons over here so one is for forget password and another one is for sign up for good password okay after that we have to write question mark and another uh button here we are going to insert it for all sign up okay now you can see form has been created let's select all these things and let's uh make it as bold 14 hold 14 and after that we have to click on ok and close this now you can see form has been created now let's uh remove this things text from this fields okay and let's save this after we have to change the layout to absolute layout you can see it get changed and after you we need to save this and let's move little bit up and we have to place a level over here go to the properties and we have to import here image you can say and that image name is uh first page background this one and after that we have to click on ok close and we have to place it perfectly on this screen okay let's move a little bit right downside and on this image we just need to double click you can see a little edit is over here so press back a space button and remove this text and save this page you can see form has been created let's move it little bit right this login and you can see a form has been created okay one thing we forget over here that uh we also need to remove min max close buttons so you can see the component is not visible so click on this it will load it okay after that we have to go to the properties and we have to undecode we have to click on this check box and we have to close this and again we have to save it okay after that just check it like it's perfect or not let's uh uh let's write the code for like uh other buttons so let's go to the login okay we generated the event for this so before writing for this uh we need to like uh need few variables and two things we need to do so let us start with that creating a variable so public string email pattern okay and here we just need uh like data patterns so we don't have pattern uh here so we just need to move to the sign up page and we just need to copy this part and we have to paste it right over here okay so we got the pattern after that we have to like uh change the this names of buttons and variable so change variable names so txt email and press ok and change the variable into txt password okay after that we also need to change the button so p t n and it should log in enter and change variable e t n uh it's clear okay and let's change this variable to so btn exit okay press and save this okay come over here so whenever the page uh load in that uh point of time we want to yeah like disable this button login button so the button name is button login so we are going to disable this button set enable and we are going to write over here false so whenever page load it will disable that button okay so we will validate it uh whenever we required okay so after that we are going to create a like method public void clear okay and uh in this we are going to like clear the fields and uh deactivate the buttons when our form gets submitted okay so txt email email dot set text and we're going to clear it so i'm just writing double quotes okay after that text ext password dot set text and in double quotes okay after that we have to write the button are we again we need to disable that button so button dot set enable okay and here we just need to write false okay so we have to call this clear method okay after that uh we are going to write the code for this exit button first so just double click on this it will generate a event okay for us and after that we have to write here into a is equals to g option option pan and press ctrl spacebar it will import over here you can see that our what we need to import and again back to over here after that dot show confirm dialog we have to select this and here we just need to write first position we have to write null and put semi column at the end okay and here we have to write the message so do you really want to close application okay and after that we have to display a top message so i'm just writing a select select and we are giving option option g option pan dot yes no option this one so let me show you the complete you can see we are writing like this okay after that if a is equal equals to zero it means that user selected yes so in that case we need to exit this application okay uh let me minimize these things okay so here uh we have to write system dot exit and here we just need to pass g so whenever or like a user press yes then it will exit this application okay after that uh like the next thing is so we have to write the code for uh like login so before doing that first we need it like we need uh like we have to create a bit head in the user dial so just move to that class user now over here you can see and here we have to create emitter so public static white and here we have to write login so i'm just writing here login okay and in this we are going to pass only two parameter that that is the string email string password and we are going to check that that user exists or not okay in this way so let's start with that and after that we have to create a user and we are going to write null okay and after that try catch block we have to use to suppress the exception of like we are writing the really uh query related to database that's why okay exception e and in this uh like whatever the either occur in that case we just need to display so g option pan we can use ribs and pan dot show message dialog null over here and delete all these parts and just write e okay after that in try block okay uh we have to call the result set okay so for that we also need to create one more method in db operation which will return us like a result set okay so let's create that now now let's move to the db operation over here and here we also need to create one more method so move little bit down over here so public static white okay not void it should return result set so we have to return the result state of that get data we are going to write the method name and in this we are passing only query string query okay and uh over here we have to try to read the connection first and it should be our return this result set type so that's why it's showing the error okay okay first we have to write this connection okay before writing this we have to write the try catch block to handle uh like whenever we get any error okay so exception e and in this uh we need to write g option and okay we just need to copy this part so just copy this line and just paste it over here okay let me minimize this and after that in the dry block we have to create the connection first so connection okay one more thing so whenever any error occur in that case we need to return the null so here we have to return null okay and after that we have to write here for connection connection on equals to we are going to call the connection provider class which we created in the last video which have a bit con method in that and after that we are going to use the statement statement st equals to con dot create statement and after that we are going to use the result set result set rs equals to st dot execute query okay and here we have to return rs okay so whatever the query we get we are going to get it we are going to execute over here and we are going to return this result set to uh whatever the method it will call okay so it will call over here so we need to like uh import okay we already have in the same package so we don't need to actually import that so here we just need to write three things like uh let's write result set result set okay set okay we are not getting any option over here so not a problem we will import import java dot sql dot uh string this one and save this and this place this okay we are getting option rs equals to and here we have to write db db operation this one and it have a get data and in that we have to pass that query so in double we have to pass the query so select start from [Music] user here email is equals to and here we have to write email and and here we have to like write password pass word okay plus plus and here we have to write also password variable okay uh which we are going for getting it from here whenever the method it will call it uh we'll get these two details in that uh after that passing the query okay it should close okay yeah it's correct okay after getting the value like whatever the output uh we will get we have to check like why rs dot next we are going to do that and here we have to like uh use a dot we have to create a new object of user okay in that we are going to set the user status user dot set status and here we have to write rs.get string string and in the doubles we have to write the column name so the column name is status okay so it will return if that user exists otherwise it will show the error or not error actually it will return like this okay and after that we have to what we need to do is like it should so here we have to return it at the end so return user at the last okay it's showing some kind of error so try catch block y okay okay here we write it white that's why it's showing it off so it should not white it should be user type which we are going to return it so that's why it's showing here so you can see here it gets removed now now which this method which we are going to use it for this login check okay so let's again move over here okay just double click on this event move to this event and in this event we are going to like uh get the details from the particular variable so string email equals to rtxt email dot get text string password equals to txt password dot get text okay and after that we have to write here user user is equals to null okay after we are going to okay it's showing error because we don't have any input for that so import model dot user because we have we created this package and that uh we have it like a class with this name that's why we are able to import it okay user equals to we have to call the user dao so i don't yeah we have we can import it when we press it it automatically import that you can see import down use it okay after that we have a method in this that is login and in this we need to pass email and password it automatically take that okay after that if like we have to check like the user so it will uh send us response in the form of user okay so in that we have only uh status details like a user is active or not active you can say true or false okay so after that we have to check here user is equal equals to null so in that case uh what we need to do is we have to display g option pan it means that user uh like entered some wrong password okay so what we are going to do is and uh displaying the message and here we are just changing the color in incorrect password so for that we are using the html so we are going to use some html tags over here so html and after we have to close the html tag and in this bit pane we have to write b [Music] and we also need to close that b okay slash and here uh in this b we have to write little bit style equals slash this one double okay color red okay slash doubles okay this one after that we have to write here in correct user name or password okay after this we have to like uh display the uh top header so we are writing that message and after this we are going to display the error message so g option pan this one dot show error message this one okay you can see this so this uh we are going to display over here after that uh if condition we also are going to write for else condition okay and else condition uh like if user dot get status this one uh like uh dot equals equals it should false consider it as false so it means that user is not active did not get approval from admin so in that case we need to display message wait for admin approval so for that what we are going to write over here is i like of we are going to display the g option pan this one dot show okay okay before this uh like uh so message you also need to we are also changing the icon of this right so for that we have what we need to do is image image icon and press ctrl spacebar okay we did not get any option i think so i think image icon okay okay we are getting it our java x swing we have to import it from here so let's check the importing here you can see the input java x swing image icon we have to import from there okay after that here we can create a variable and here we just need to write new image icon option this one and here we have to pass the source of that so it should be src and pop up icon and here we have to write bait dot png image we have a image in the icon we pop-up we are going to use that over here okay so let's minimize this and again move back to over here and in this we are also going to use the html over here okay so html we are going to close this html okay and here we are going to write b closing uh this one b okay and here we are going to write wait for admin approval okay after this uh we just need to display over here like header which should write message and at last j option pan dot information message okay and after that we have to put over here comma and we have to pass the icon this one we are going to pass over here okay you can see the complete line at once after this we just need to call that clear method so clear the field okay after if condition we are going to check for one more condition if user dot get status dot equals true okay in that case what we need to do is we just need to hide this page and we have to move to the another page so for that uh first we need to create a page okay uh let's create a page over here so here i'm just creating a jframe form just making it as a home okay click on finish and in this uh like we also want to pass the whenever any user login successfully we are going to pass that email address from login page to sign like home page so for that we need to do a few things so just copy this line and paste it over here okay and to format this you just need to click on this right click and it you can see and here we have to write string email so it will successfully get that value okay uh and uh it will be here we can use that okay so like when we are passing that uh like from calling home page so in that case set visible first do this false and new home and you can see we are getting two option because it having two constructor so here we are going with the email address you can see automatically we've taken this email address and after that we are making it as it visible and here we are making it as true so now when we enter the correct username and password it will go with on home page with our email address okay so it will work fine i okay so let's check it uh let uh before checking it first we have to do the validation because right now it's get disabled so we need to enable that before like checking anything so let's move to the top of like source uh over here or below the clean okay public white and validate field okay and here what we need to do is we have to get the string to variable string email equals to txt email dot get text okay string password txt password dot get text okay get text this one okay after that we have to check if let me move a little bit down email dot match and here we have to pass that our email pattern email pattern this option and we have to check that out the password should not like an empty so password dot equals and it should not like this okay and uh after that if in this condition button we have to do like enable that button so button dot set enable and we are making it as true else what we need to do is we have to deactivate that button so button login dot set enable false okay so after that uh like we nee also need to call these metrics so for that we just need to generate the event so key released and for this also event key released okay so we are going to call that meter validate validate fields okay validate fields okay so it will work uh after that we have to clear so in this we have to call the clear method obviously okay after this uh like uh uh let's cheer let's run this and let's check it out so i think uh the password is gaurav at the red gmail.com so let's check it out gaurav gmail.com and the password is one two three i think so it will move to the i think login page let's just uh i read the password is one two three four just try this for login incorrect username and password because we entered the wrong password okay after that let's try with uh one two three and login wait for admin approval because we did not uh like approve for from the admin till now we did not implement or anything related to admin actually in the same table user table we are going to store the admin uh raw details also let me exit this application and let me add the admin details from here actually we are writing the admin details over here because like if you like uh switch from this system to another system in that case uh maybe you forget that we have to enter a email address also uh that's why i'm going to write here and uh you can also directly use the sign up part for that and you can assign any like for any user you can write uh use any email address okay so let us start with that so here we have to create a variable string variable string and admin details [Music] okay and here we have to write insert insert into user and here we have to write one by one name email mobile number okay and address password after password okay the next is uh for security question okay after security questionnaire is answer after answer the next is the status okay and here we just need to write values and the bracket we have to insert all the details okay we can also uh like sign up from sign up page but uh we are going to write it because it does not need to be deleted like whenever you will create a new table in that case you directly insert for the admin and you start working for that okay i'm just writing here the first thing is name i'm writing here admin okay after admin i'm also assigning the email address so we are making at email address is unique so we can use any email address okay dual.com so i'm just trying to write in this email address okay and after that we have to write one two three four five six seven eight nine zero on while number you can see and here we have to write the country address you can see after address uh the next thing is uh we are going to write uh like next option is for okay password and okay yeah address ah okay after that we are going to write the password so i'm writing the password as the admin after that we have to write the security question so i'm writing here what is what primary school did you attend okay after this uh like we have to answer okay so answer let's consider it as ebc okay and for this obviously it should be true because we will approve all the users that's why we have to insert it manually okay so we are going to execute this query so in the same way we just need to copy this and paste it over here and we have to like uh run this query so we need to paste it over here admin and here we have to write admin details added success fully okay let's save this and let's comment this control okay comment this line and comment this line okay after that we have to okay sorry we don't need to comment this we need to comment this line okay so let's run this right click on this run file okay so it need admin it is added successfully we get the message so let's open the this database and let's check it out okay you can see we have to use them uh so like you can see the status of this user is true okay so we can log in and move to the home page with this kind of let's revert this like commented part okay and let's save this and let's move again to the login page and let's run this page okay and let's try to login with admin at the gmail.com and here we have to write admin as a password let's try to log here you can see we are able to move to the home page so uh uh after that we have to underwrite like so the buttons according to user okay so let's close this and few more things we which we need to do is over here so we have to connect other pages to this so we just double click on this sign up set visible so here we have to write false and new log okay we have to pass to the sign up signum dot set visible true okay we just need to copy this line and we also need to move to the sign up page we also need to connect sign up page with a login page so just double click on this and over here we just need to write this and right click and make it as format okay and here we just need to remove this login okay let's just test this once that we are able to navigate it or not okay so let's move to the signup page yeah it's working fine okay we are able to clear everything okay we are able to exit this application so this is all about login part of my cafe management system i hope you guys like this video so please hit like and subscribe my channel thank you hello everyone welcome to my youtube channel in the previous video i just show you login part of my cafe management system project if you are not seen that video just go to the description and check out the link in this video i am going to create a new jframe for this target password so let us start with that let me exit this application and let me create a new jframe for that new jframe form for good but password after that we have to click on finish it will create a form you can see over here after that we have to increase the sizes to one three six six comma seven sixty eight after that we have to click on ok so it will increase the size of this so after that we have to move to the center of this page little bit and we have to place a label over here and we have to rename this forward password okay and with question mark and we have to increase the sizes to old and 36 okay and we also need to change the color so it should be 204 and we have to click on close you can see the color has been changed now let's move little bit down and here we are going to insert one by one the labels so the first label which we are going to use it for email and the next label which we are going to use for the security question your security question security question okay after that we have to use next level so the next label name should be your answer and so and the last we have to take the label for enter enter new password okay after that we have to insert fields for this so let's uh insert few field text field over here let's increase the size to 300 351 okay uh let's uh insert another for security question so text field okay let me increase the sizes to this and the next one is for answer we are also going to use a text field and for password we are going to use password field so let me place over here let me increase the size to 351 okay after this we just need to select this all and we have to increase the size to bolt 14 so just select this bold 14 okay close this and one more thing we need to do is we have to place a button over here to search so let's edit this search okay and we also need to insert a icon in this so go to the properties and we have to go to the icon we have to select this one image after that we have to check for the search icon we have a search icon over here so you can see this one search.png click on ok and close this after that uh we have to insert few more buttons over here so let's insert one by one so this one and the last button okay and two more button for log sign up and log in so let me place it over here okay so let's change one by one the text of this so this one for clear okay the size is uh is getting changed so let me change this layout to uh this absolute layout okay and after that we are going to change this go to the properties and uh okay so we are setting the image first so this button is for the update so we are going to save icon save should save icon save.png okay close this and for this okay we also need to change the text so here i'm going to update okay and after that we have to write here clear okay and for this we have to write exit okay okay after that uh we have to write here sign up okay and for this we have to write login after that we have to insert the icon in this so let's select this images and here we have to select the exit small exit after that we have to close and we have to also select the clear icons so images clear it should be at the top clear.png okay after that we have to select this all buttons and we have to make it as bold 14 so we have to select this hold 14 okay just close this now now uh we have to move this one to little bit right and this one should be like this okay after that we have to uh remove this text field by default text fields values from here you can see uh it uh this values had been has been removed after that we have to change the variables name so txt email after that we have to write her change variable pxt security question okay after that we have to write her txt answer okay and at last you have to write txt new password okay and just save this after that we also need to change this uh name so btn button btn update and we have to click on ok after that we have to change this variable name so btn btn clear okay save this so we don't need to change these things because we only once we are going to use this so let's leave this now you can see our gui has been completed we just need to insert a label in the background so let's select this and move it over here after that we have to go to the properties and we have to select a icon for this images and you can see full uh first piece background.png image okay close this move to this completely on this page and move a little bit right add center okay and double clicking you see the label name press back space button and save this okay so now you can see our gui has been completed but it's little bit right compared like we need to move little bit uh left to this so just select this all one by one by pressing ctrl button okay and we have to just move this to over here so now it's looking perfect i think yeah and one more thing we forget over here that are we did not remove that mean max close button so just click on this you can see jfrom form is visible go to the properties and we just need to click on this and record it okay after that we have to save this page you can see our gui has been completed now now we have to move to the source of this page and the first thing is we have to declare few variables over here so here not over here actually uh we just need to below this one class public oh sorry private because we are going to use this variable in this page so db answer is equals to null okay after that private string email is equals to null and private string email pattern is equals to in doubles we have to write the pattern so in the sign up page or you can see login page you you can able to see that the pattern so we just need to copy that pattern over here so we just need to post paste it over here okay we are getting some mirror okay we don't need to write this over here okay after that uh the after that we are going to move into the for this one over here and here we have to like we have to disable that uh save button this button update button and search button both button so whenever user move to this page we should not enable this button only when using the email address this button should be enabled when a user enter this details we need to enable this button so for that first we need to disable that button so bt and update btn update okay dot set enable and here we have to write false okay one more thing we forget to write i think uh for this variable so bt b tn search click on ok and save this after that we have uh moving back to here after that button search this one dot set enable and here we also need to write false okay and after that we have to uh like we don't want a user to change this uh like security questions so in that case you can write here txt security question dot set iditable uh actually it will not affect your anything like uh we are not saving uh that security question in database from there but you can make it editable or not it's on upon you okay make it as false after that a method we are going to create over here which is for the clear fields so public public white uh like here we have to write clear and in this skill here we are going to do that button update okay so this thing okay it should be like uh we have to let's say we have to copy these two things first so let's read this and after that we are going to write here vtn uh sorry text field email okay email dot set okay so whenever any user search for email address after that we are going to disable this button and we are also not allowing any users to change the email address so so after like when we uh update that then we should enable this uh field and also need to disable this button so that's why we here we disable this that button and now we have to in uh enable this field so let's change this dot set item and here we have to write true so that any user user can write the email address after text email dot set text we have to clear that text so we just need to write this okay and txt security security question dot uh set text text and we are also going to remove the security question and txt answer and say dot set text okay and after that we have to write txt new password dot set text and in doubles okay so this is uh about the clear like killer clear the page okay after that we are going to uh write for like email validation for like any user enter the email address according to that this button should be validate so we are going to write for that so public void validate email and after that we have to write here so email is equals to txt email dot get text this one after that if email dot match match match email pattern we have to select this in that case uh what we need to do is button dot not killer so button search button search dot enable and we have to make it as true okay in else condition uh we have to disable that search button so let's check once uh sorry set enable enable and here we have to write false okay so let's check it out it's uh okay uh we don't need to check it because uh exit button is not working so uh exit will cause in some issues so let's move forward so now we are going to write the for validate fields for these fields okay so let's copy this uh this thing no no we don't need to copy like right we are going to write it public white validate fields okay after that uh we have to write here string it should be s should be capital and all other letters should be small password is equals to txt password txt new password yeah password okay dot get picks so we have to select this after that string string and so equals to txt answer dot get text after that string string security question txt security question dot get text this one and after that we have to write a first condition so if password dot equals and this should be like this then we have to like not equals to like this then we have to enable that button other than that we also need to do the same so it should be and and and after that answer dot equals in doubles okay and security question dot equals and here we have to just write this after that button button update dot set enable dot set enable and here we have to write true else btn update dot set enable false okay so you can see the validate fields uh we write the code for validate the fields so we also need to call this field uh these things are methods so for that we need to generate the events so just right click on this event key key released okay event has been created so key event he released and after that for the this one also event key released the next one this one event key released okay so the first one is for the email address so i'm just writing here validate email feed this one option after that for other three we have to call the validate field methods okay so just copy this and paste it over here and we also need to paste it over here after that save this now after this we have to write the code for this exit button so just move over here we just need to double click on this it will generate an event and in this event we have to write end a equals to j option tan this one dot show show confirm this one confirm dialogue and first we have to write null after that we have to write here a message and we have to put semicolon at the end and here we have to write do you really want to okay one two close application after that we have to display the header so select i'm going to display over here after that we have to show the confirmation so g option pan dot yes no option we have to select this okay and we have to move to the next line if if a is equal equals to zero so in that case user selected uh this is selected yes so system system the last one dot exit and here we have to just write 0 okay so you can see forget password is like for this exit application also working just check out the it's validating or not so let's open that okay so we just introduce esd something like that at the gmail.com you can see it's validating okay we don't uh we cannot edit this so we cannot check this check this button for validation so leave it for now let's exit this application okay now now we have to move to the clear so just double click on clear and in that case we just need to call the clear method you can see this one after that we just need to move to the next button so you can see this one is update so just double click on this move to the event of data and we have to write here we have to take the email address email txt email dot get text and we are going to store in the variable which we created at the top of the page over here you can see the email address okay after that here we have to create a user uh like we are going to create an object of this model user so i don't think it will import it automatically so we have to write here import model dot user okay you can see we imported that now again move back to over here user after that user is equal to null okay after that we have to create a method we need to create a method over here so let's delete this and we have to move to the user dial so you can see we have to move to the user.java you can see we have created user doubt or java in this page you have to move to the bottom of this page and here we have to create a method so let's write here public static void okay it should return the user type so user get security t question articulation and in this we are just passing a email address okay and here we have to like uh we need to select the user user is equals to none after that we have to write here try catch block cash block here we have to write exception e okay let me move a little bit down and here we have to write here g option pan g option pan dot show message null and we have to display the error so we just need to remove this and at last we have to like uh return it so we have to return this so i'm just going to write this return that's why it's showing the error so return user so you can see either get has been removed after that we have to write the code to like get the security questions so here we are going to use the result set result set rs is equals to db operation we are going to call that db operation which having gate data method and in this we just need to pass the query so here we have to write select select star from user email is equals to single double plus plus and here we have to write email address let me format this page you can see it will automatically like make changes in the space and all it will take care of that after that we have to write y by rs dot next in that case uh we have to set the values so here we have to write user equals to new user okay and in that and that we are going to set the user security question set security question you can see and here we have to write rs dot get string and in this we are going to write the column name so security question and after that we have to write user dot uh set answer we have to set answer second option and here we also need to write set get sorry rs.get string it should not be in doubles so rs dot get string this one and in this we have to write answer okay so whenever someone send us email address we are going to select that and according to that we are going to set the security question and answer if any exception generated we are going to show this after that we are going to return the user okay so now again move to the forward password page over here and in this uh uh we need to get that uh user details so user is equals to user okay we are we did not important user dial so we need to move to the over here and we have to import import user dow this one dot we have to okay we don't have anything need to import extra okay tao dot user down okay after that we have to move back over here again so user dao this option we need to select and in this we have to select get security question and this we need to pass the email address you can see automatically taken the email address after that we have to check if user is equal equals to null it means that our that email address is wrong we don't have any uh email address we don't have any data with that email address so in that case we need to display error message so g option pan dot show message not a message dialog yeah and here we have to write null and here we are going to display that error message so we are going to use the html tags and all over here also so html and here we have to write making it as bold and we are going to change the color to incorrect email address so b and we also need to close this b okay and here we have to write uh like incorrect correct incorrect email okay after that we have to change the color so we have to move here and style style equals and we have to place this and in doubles we have to again we have to after that uh we have to place over here this one and here we have to write color red ah it should be red should be small okay uh capture should be also work not a problem after that we have to uh like we also need to display the select okay message header message and after that we have to select the error message so g option pan dot or either either message this one second option and after that we have to write here we have to write for else conditions so this is all about if any user does not exist after that we have to write else condition so in that case if you have to write button search first we are going to disable this button if your username is correct email address is correct then we have to disable this button so button dot search dot set enable and here we have to write false and after that we have to uh we have to disable this but field also to not make changes so txt email dot set editable and here we have to write false and after that we have to make a security question i think we already disabled the security question so we don't need to disable this so after that we have to like extract that user details so db answer db answer equals to user dot get answer so we are going to get the answer from this and uh after that we have to set the question to that question to this field this field so txt security question dot set text text in this user dot gate security question we are going to extract it from here after that we are going to validate field so whenever we call this so we are not going to change the this field text so that's why we call that once over here after this we have to next step we have to write the code to update okay once uh we did something wrong over here so we have to write the code for the search button sorry for that we just need to copy this part of the code or not copy we have to cut this and we have to paste in the search button actually so whenever user search anything then only should uh then we have to write we have to go for update now after that we have to write the code in this update button so just double click on this you are able to move to that event after that here we have to write a string and so and here we have to write text answer okay after that uh here we have to write git text and we have to write new password and here we have to write text answer dot get text this one and if and so dot equals uh like a db answer we which we already extracted and we have set in this variable so if it equal then it means that the user inter enter correct answer so in that case we have to update our database with the new password else we have to display the error message so here we have to write like error message so we are going to directly copy that error message from here so just copy this line and we are going to paste it over here and we are going to change the message so incorrect email to incorrect answer okay after that we have to create a um method in user dao so here we have to create a method so move it to here and here we have to write public public static void okay one more thing i forget over here so select star from user and here we have to write where clause because it's uh this query is wrong okay after that we have to move back over here again update and here we have to write string string email string new password and after that we have to uh we have to call the db operation before that we have to also need to write the query for this so in doubles here we have to write update update user set password password is equals to in single double plus plus okay and here we have to write new password this variable after that uh where email is equals to equals to a single okay it should be in this like this press plus and here we have to write email address and last we have to put semi column sorry okay it should be one after the semi column you can see let me format this then you can see it correctly okay and at last we have to put this okay so it should be update user said password single double okay plus new password same the email address is this and after that we have to pass this query to db operation db operation dot sit data and in this we have to pass the query and in this we have to write password changed success fully okay uh sex is fully okay so let's save this and let's back to okay we are getting some error okay move a little bit okay okay it should be like uh not like this we have some which it should be like this we added some extra semi column so we didn't need to delete this so let me show you like at once complete this query okay and you also need to change it over here where we have to add in this query after that move to the forget password again over here and in if condition here we have to write user dao we have to call user dog dot update this one and we have to pass the email address and you can see the new password so we have to pass only two variables and you can see we are getting the email address and new password and according to that we are updating the like this changes updating the new password so after that we have to call a clear method so to clear the field so clear this one so we also need to change this uh by mistake i just write here txt answer so but we have to write here new password we are we are going to take the password from this field this field that's why we have to write here txt new password and this password we are going to send to the over here so so after that we have two few more things we need to do is for the sign up piece so set visible and we have to write here false and the new visible sign up dot set visible and here we have to write true so we have to copy these two lines and double click on this login page okay so we need to paste it over here we need to just change this login login we have to format this it will automatically set according to like uh same way save this so in this page for designing and coding part is done we also need to connect other page with this so at the login page move to the forget password and here we need to copy this and here we have to just change the fault it password and we also need to move to the sign up page so let's move to the sign up page and move little bit down forget password and we have to paste this lines and we have to write your forget password so let's format this okay so now move to the forward password let's run this and let's check it out it's uh work fine or we are getting any error so let's enter email address admin at the rate gmail.com and let's click on search so it should select a security question and it should display over here so our correct answer is abc and we just want to set the admin one the career like so it should first need to display the wrong so let's abc one try to update it it got incorrect answer when we click ok it will not affect anything so let's change to the admin uh sorry admin one update it okay it should also delete this and update this in this case you will get password change successfully okay click on ok so you can see it's working fine let's uh make this admin password again to the admin so here we have to write abc and here we have to write admin and we have to click on update password change successfully it means that everything is working fine so this is all about forget password part of cafe management system project i hope you guys like this video so please hit like and subscribe my channel hello everyone welcome to my youtube channel in the previous video i just show you forget password part of my cafe management system project if you are not seen that video just go to the description and check out the link in this video i am going to create a new jframe for home part so let us start with that let me exit this application and we will move to the home page when we are able to successfully log in so here you can see we already created the home page so we have to design in this page so let us start with that so first we have to increase the sizes to 1366 comma 768 after that we have to click on ok and we have to save this page and we have to open the palette and we have to insert the button one by one so here i inserted the first button so let me read this and let me write here log out okay after that we have to insert another button and we are going to place it one by one first after that we are going to rename this things okay buttons name three four five and last one this one is six after that we have to change the name one by one so this one is for the exit and this one is for change security question after that the next button this one is for view bill and orders order placed details okay this one and after that we have to write here please okay one more button here we need to change it and here we have to write uh like let's copy this and let's paste it over here and this button we are going to use for change password and this button which we are going to use for place order after that uh we are going to select all these buttons and we are going to make it as bold 14 we are going to make it as bold 14 okay just close this uh let's check out the size of this frame it should 136s comma 768 correct after that we have to insert the icon in this so let me select this images and here we have to select log out and we have to select this okay close this and after that we have to okay let's move little bit down and we also need to select more button for the admin so we are going to place at the bottom of the page so before that let's uh insert all the icon and here we are going to insert the place order images and here we have this order this icon please order dot png image and after that uh the next which we are going to insert for view bill okay it should be image view well okay so it should be like this one no not this one actually uh yeah you will it's the first one we have to select okay close this and for change password we are going to select the icon which we have this one not this one changes change security change password and after that we have to go to the properties again we have to select another image for this and change security question okay close this and at last we have to for exit this application and exit it should be exit dot png image and we have to close this let's uh place little bit space in this buttons between all buttons and save this okay after that we have to move little bit down of this page and we also need to place some buttons okay first check out uh like the size of this page yeah one three six six comma seven sixty eight it's according to my screen size after that we have to here we have to write manage category and we also need some more buttons so new product new product and another button and this one is view edit and delete product and the last button which we are going to use it uh verify users and after that we have to select all these buttons and we have to make it as bold 14 okay just close this after we have to insert the icon one by one so here we have to select images and for manage we are going to select for manage category and this one okay we have only category.png use that okay close this new product so this one should be images and new product we have to select okay this one we are using for new product okay close this and we have to go to the properties again we have to select another icon and here we have to select ok and we have to close this let's save this and let's again go to the properties and we have to select another image image and the last which we have to select is verify users okay close this now now we have to move to the center of this page you just minimize this and let's move little bit to center this one and let's check it out this one is not at center so let's move this to the little bit uh right and try to make it as center after that we also need to uh like change the position of these buttons so just select this all and we also need to place it a little bit center so it look like that let's move this down yeah now it's looking at the center now go to the properties of this j frame and click on this so that your the mean max close button get removed after that we have to change the layout to absolutely how to insert the images in the background and after that we have to open the palette and we have to insert label and place it over here and you have to go to properties and we have to select a image icon you can see and home home background image dot png we have to select this click on ok close this place it to the perfectly on this screen and we just need to double click on you can see the label is visible over there we have to press the back space button and save this now uh when we open this it will open in the fullest screen so leave that for now uh now here you have to write some line of the code over here so let's move to the source of this and we already write this discuss we already created this one and in this we are getting the value string from the login page okay after that we have to write here public string we have to create a variable email in this email address we are going to store the email address which we are going to receive so let's change this variable name to user and make it as email and in this email address email and we have to leave right here equals to user and here we have to write email after that we have to check one condition over here that like whenever admin login in that case we have to disable these buttons no sorry opposite of that whenever admin login we have to show these buttons if any normal user login in that case we need to uh like hide these buttons right so 7 8 9 10 okay so we are also going to change the button same so that we can easily identify okay button category and here change the variable name button new product and change variable name button uh view edit delete product okay and at last we have to change the variable so button verify users and save this so we are going to do some changes like uh we are going to hide and show that's why we are using this like we are changing the variable name otherwise we are not going to change it okay so uh because we for this we have to only open that page particular page that's why i did not mean make changes and let's save this and let's move to the source okay and here we have to write email dot equals equals and here we have to write an email address which you want to make it as admin access so i'm just writing admin at the read gmail.com so for this user i already registered for this user you can see admin gmail.com i don't want to provide access to this user as an admin okay you can also use any email address you want over here after that we have to write here and in if condition okay just save it you can see either get removed so g okay we have to write your button button category dot set visible and here visible we have to write false and the same b button and here we have to write new product dot set visible okay visible it should be visible and here we have to write false one by one we are going to write button and very uh this one and we have to okay button dot set visible and here we have to write false and button and it should be verify user dot set visible and here we have to write false okay visible false okay and and if after if condition we have to write some code for this log out page and so just need to double click on that it will generate event and for exit we are also going to generate the event okay so first we are going to write for the log out so just right here in a equals to g option pan dot show show confirm dialog this one and here we have to write null and here we have to write do you really want to close application okay it should be like it should be log out do you really want to log out here you can write whatever the text you want you can write it over here let me place the semi column so that it'll get removed select and after that we have to write here g option pan this one and here we have to set for yes no option and if a is equal equals to zero and here we have to write uh like uh we have to like we are just writing the code for this one log out right yeah so here we have to write state visible we have to hide this page so i'm just writing here false and we have to write here new and here we have to write the move to the login page i'm just writing login dot set visible and we are making it as true after that we have to copy this theme line of this code in this button and save this and just right click on this and we have to click on format it automatically form it which look good okay after that we have to just need to change over here i want to close application and we just need to delete these two lines and here we have to write system dot exit and here we have to pass the zero so now now whenever like we will going to log out it will ask for confirmation and it will move to the login page and when we try to exit this application then it will close our application so and here you can see we can see also like a user for admin it will show different buttons like it will add view display few more buttons but right now we don't have any active user here you can see status is false let's update this so update user so that we can see that like uh whenever we log in with normal user so it should be different that's why i'm is updating it from here otherwise i will going to create a module i already show you in the video so just write set uh here we have to write status is equals to just right here true where where id is equals to one so you can see it's affected our like uh you can see a status has been given to true so let's test it and we after that we are going to revert that okay so let's run this home page and let's try to log out do you really want to log out when we press on yes it will log it out okay so let's try with uh normal user got up at the gmail dot com after that we have to write admin let's try to log in okay i think the password is one two three so let me try with that you can see we are able to log in successfully but we are only able to see these buttons because the email address does not match with that okay so let's again try with like admin admin at the gmail.com and here we have to write admin and you can see the buttons are visible right now so let's try to exit this application so yeah everything is working fine related to home page so this is all about uh home page so i hope you guys like this video so please hit like and subscribe my channel thank you hello everyone welcome to my youtube channel in the previous video i just show you home part of my cafe management system project if you are not seen that video just go to the description and check out the link in this video i am going to create a new jframe for this manage category so let us start with that let me exit this application and let me create a new jframe for this so new j okay we have to click on new jframe new jframe form and here we have to write manage category and after writing category we have to click on finish you can see a page has been created so first we are going to increase the size of this so we are setting it to 700 comma 400 after that we have to set the location where this form will be open so we have to move to the location and here you can see location is not set so we have to set the location of form so i am writing for x axis 350 and for the y-axis i'm writing here 134 after that we have to close okay and we have to close this and we have to save this and after that one more thing we forget over here like we have to remove min max close button so we just need to click over here and we have to close this and save this a key after that we are going to insert a label and we are going to insert a button over here yeah so in the label first we have to write here manage category after that we have to insert the icon in this so just go to this and okay we also need to increase the size so make it as good first after that we have to insert the icon so just click on this we have to select this one image select and here we have to search for category you can see this one option we have to click on ok and close this after that we are going to insert a icon for this so let's place here a icon image and we have to select this close dot png image and close this we have to edit this and remove this also just decrease the size to let's say make it as 30 okay after that we have to place it over here top of the page after that we have to insert here a few things like we have to insert a label let's write here view category and we also need to insert a table over here so let's place it for now over here and let's move a little bit down and let's place a table okay this will affect our i think yeah so let's decrease the size of this and place it here let me decrease this one also let's move a little bit right and let's uh let's yeah again it's decreased to 700 and 400 and save this you can see it's also decreases after that we have to go to the table content and we have to move the column so the column should be only twos uh okay it's column so it should be two and the first one is for the id we have to display and the second one is we are going to display the category i'm just writing here category and after that we have to move to the draw and we have to remove all the raw so just click full time it said to be 0 and we have to click on ok you can see after that we have to place it over here and let's decrease the size of this and let's increase this one and let's move a little bit right and let me move this one also and let's go to the properties and making it as bold 14 okay 14 close this let's now move a little bit right also after that we are going to place one more label here and let's write here some text like we are writing here click on raw to delete category ah okay okay it's get changed because we click on that side so we have to write it again let's edit this text and let's write again click click on draw to delete category after that we have to click on the screen okay and let's move little bit right this one and after uh doing this we have to like we have also need to insert over here so we just need to place a label and in this i'm just writing add new category and after that we have to place a text field to insert any uh like any text any category so let's place it over here let's increase the size of this 121 uh let's uh make it as 235 and after that we have to insert two buttons over here one is for this and another is for over here and let's uh edit this text and let's write here clear and after that we have to insert the icons so let's go to the email icons and here we have to select images and here we have to select the clear icon so icon or you can say png image after we have to insert here like uh save button images and here we have to uh select for save let's move to this one save okay and close this and let me read this text and let's make it as safe after that what we need to do is we have to just select all these things this fields and we have to make it as bold 14 so let's move to this hold 14 okay close this and save this after we have to move this one is little bit right make it as center and also we are moving a little bit right and let's remove this text from here and just save this now the next thing is what we need to do is we have to change the layout to absolute layout after that we have to insert a label and we have to go to the properties and we have to import an image so let's uh image and here small background images some small page background dot png we have to select that image okay close this and place it perfectly on the screen and double click on this you can see the label is visible we have to press the backspace button to remove that and save this now you can see all is in the black right now so we have to select all these things whatever in the black and write click on this and we have to go to the properties and we have to change this to this one okay and close this you can see perfectly as similar as uh like uh the quick overview video now you can see our gui has been completed the next thing is what we need to do is we have to create the table so we have to move to the table.java class in this one and we have to write we have to create a variable in that we are going to write the query so category agree table equals and in doubles we have to write create table or category and here we have to write id int auto auto in agreement okay after that we have to write primary key and the next uh we have to write here is we have to write here only for category name so name bad care and here we have to write 200 at last we have to play write semicolon you can see it has been created now we have to copy this line this line and paste it over here and in this we have to just pass this category table and here we have to just change little bit and here we have to write category table created successfully so uh this this two tables is already there so we are going to comment this and uh let's right click on this and run file so it will create a table in our database we are also going to test that we also saw a pop-up message category table created successfully after that we are going to again remove that comment and let's save this and let's open this mysql database so our database name is cms so tables you can see we have two tables right now we have user and category so it's working fine after creating tables the next thing is we have to create a model so we have to move to the model we have to go with like java class and here we have to clearly write here category category and we have to click on finish it will create the category in this we are going to declare two variable private int id private a string name and after that we have to generate the data setter to right click on this and insert code and we have to move to the generate uh generate git sorry getter and setter and we have to select on this all you can say and we have to click on generate it will generate the get reset you can see automatically hydrogen generated now after that we have to save this and we have to close this and after that the next step what we need to do is we have to create a dial for this so just right click on dow package and right click and create a java class and here we are going to write the category category down and after that we have to click on finish you can see a class has been created now here we are going to like like we are going to oper whatever the operation which we are going to do over here for that we are going to create the method like say we are going to insert so first we have to like to write the method to insert after getting all the details after deleting all the details we are going to create all these things over here now so let me start right here emitted public static void save and in this we are going to get the category and okay we need to import this so import and here we have to import the model dot and we have to import category so you can see after that we have to write here category same in small after that we have to here we have to write the query so let's write here a string query equals and here we have to write insert into category uh here we have to write name name values and here we have to write in single doubles plus plus and here we have to write category this one dot git name and at last we have to put the semi column and after that we have to call the db operation this one method and in this we have to pass the set data and in this we are passing the category okay query sorry after that we have to pass the message so i'm just writing here category added success fully okay you can see one method has been created to save like a new category so whenever we click on save it will trigger this one method after that like whenever page load it should load all the details in this table so for that like we are going to create here one more method so let us start with that and public static and here we have to write the area list actually add a list okay and here we have to like return type should be category so here we just need to execute the coil that's why we are not returning anything that's why we write a void and we have to return a category type of like add a list so that's why we are returning this and after that we are getting it method name it records and and it will show here because we are not returning till now so let's say add a list add a list and here we have to write category category this one and here we have to write adding list we are creating a variable and here we have to write add a list category type okay and we just need to press the semi column and after that we have to write here try catch block catch block and here we have to write exception e and in this we just need to write g option pan g option pan okay so let's press this g option pan dot show message okay and here we have to just write null and save this and the try block okay uh so to we are still getting errors so we just need to return this so this error will get removed so return this added right here add a list you can see it it has been removed okay after that we have to get the result set result set result set this one okay we are not able to import it let's uh import move over here import java dot sql dot strict and save this let's move back over here let's place this you can see we are getting the result set rs equals to after that we have to call the db operations dot get data and in this we have to pass the query so select star from category and here we have to write semi column at last after it will return all the category which you want and while rs start next this one and here we have to just write category create the object of category this one and here we have to write category new category we have to create this one and semi column and in this we are going to set the values so category dot set id and we are going to retrieve it from database to get and it should be in that's why we are writing end and here we have to just write id and exactly same we are going to do for other category dot get sorry set name set name rs.get string and here we have to write name you can see after this we have to write add a list add a list dot add and here we have to pass the category that's it so it will return all the like if you select a start from if any data related to category is available then it will return and we are going to call it so in this way we are going to return it after that the next method which we are going to create it over here to delete any like category so public static void delete and here we are going to delete it by the ids string id and here we have to write a string string query is equals and here we have to write delete from category category now let's place semicolons so it will remove all the showing over here and after that video id is equals to single double plus plus and here we have to write id and after that we have to write db operation the exactly same dot set data you have to pass the query and here we have to pass the message so category deleted successfully successfully and save this so you can see all these methods which we are going to use in the cat manage category like manage category page so let's get back to the manage category this page and let's change the variable name like our field same and button same so we are going to write text name okay and change the variable tx okay btn button save save here we have to write and okay and here change variable btn clear okay and save this now now we have to move to the source of this uh page and we have to move over here so first thing is what we want to do is we have to disable this button so whenever text is there then we are going to enable this button so we just move over here and here we have to write ptn save we are going to call that and dot state enable and we are making it as false after that we are going to write a method to validate that button so public void and here we have to write validate validate and here we have to write like a string we are going to get the value category name category equals txt and name dot get text this one and after that we are going to write if category dot equals and it should be in doubles like uh nothing is there so in that case button button save dot set enable and here we have to write true and an else condition button save dot enable we have to write here false okay so in this way we are going to validate it so let's create a like to call this we are going to generate event key released this one and here we are going to call that method so validate field you can see after this like the next thing what we need to do is we have to write the code to save this category so save this category so for that we just need to double click on this save button double click on save button it will generate a like event in that we have to write so we have to create a category object i don't think it will import automatically so we have to import it manually so move back over here okay not over here so here we have to write import and here we have to call the model dot category and let's back over here again category and in this after that we have to create a category write the variable name after that object category this one and category dot set name and here we are going to call that tightly text name dot get text directly we are calling that value and after that we are going to call it tao so import that first import and here we have to write dow dot category dao and let's back over here and category tao this one we have to call this and in this we are passing this category this one and in which we have set the text name uh sorry the name of the category and after calling this we are writing a state visible we are hiding our page and we are showing the new page exactly same so manage category dot set visible and i am directing true okay so this is all about this c button this one after that the next uh we have to write is uh like for form uh like whenever the page load in that case we need to display all the category details over here so let's move to the source again back over here and we have to generate an event so let's move to the design section and click on this page open the navigator if this option is not visible you just go to the windows click on navigator it will visible okay after that we have to right click on this and you have to generate event so move to the this one component show click on this to be generated event you can see over here after that here what we need to do is we have to write here default default table table model we have to call this model this one okay so it's not important yeah so we can import it from java x swing dot table displace this it will automatically import something so let's see you can see here from here we imported that you can also write it manually not a problem after that uh we have to write here dtm and we are creating a variable just like that so after that we have to write a default default model dot t table the table name so table name is one so get model this one and here we have to pass the add a list that we have to add a list add a list this one and that should be a type of category so here i'm just writing category and here i'm going to write list and after that we are going to write category category dow dot get all the records over here and after we have to call the iterator basically it will extract the values so it should also type of category category after that iterator we are declaring variable after that list dot iterator this one we are going to call it after that while iterator dot sorry has has code okay we are getting some error over here okay let's check it out what type of error which we are getting category and let's start okay we are getting some error let's check it out category dot okay okay so we okay it should be it not this so it should be iterator actually that's why we are getting error okay it's not able to import it let's move over here so just write uh import java dot lang package asterisk and save this move back over here let's press over here okay it's still showing uh some error okay i think i did something wrong over here so it's not belongs to i think lang package okay let's check this out okay it belongs to util package so let's write here util and it will automatically get removed i think yeah you can see it has been removed from here after writing iterator here and we have to import the util package and after writing if iterator exists in that so we have to write here category category category object let's uh this is object and here we have to write iterator dot next and here we have write dtm dot add draw this one and here we have to write uh okay here we don't need to write select this one as code we have to write here next hash next this one option and after that we have to write here new object this one remove this and it's um here and here we have to write category object this one dot get id comma category object dot get name this one and save this so now when we run this page so it will uh load automatically all the details related to category but till now we did not added anything so it will not going to load anything okay after this the next thing what we need to do is we have to write the code for delete whenever we click on this raw it will delete that particular record so let's write for that so now we have to right click on this we have to generate events so we have to click on mouse click even this one and in this we have to write the code so whenever it will click a mouse on particular raw so in that case we have to get the index of that j table 1 dot get selected raw we have to get the selected draw this one and after that we have to write it table model this one model this one we have to import from java x swing table this one and after that we have to write here model equals j table one dot get model and after that we have to get this string id and here we have to write model dot get values we're trying to get the values of that particular model and here we have to write index and here we have to write the second at second option we have to write zero because we are getting from the first first column to string this one and save this let's copy this line of the code and paste it over here again and here we just need to change in the variable here we have to write the name and here make changes to one so it will get the value of second column after that we have to display like uh you want to you want to delete confirmation message we want to display so int a is equals to g option pan this one dot show message dialog this one okay not message dialog actually uh we have to display the confirmation dialog and here we have to write first at first place we have to write null press semi column at the end of this delete this part and we have to write the message do you want want to delete and here we have to display the category names so we just need to do is we have to doubles and here we have to write plus plus and here we have to write name and after that we have to write here category so after this we have to write here select select and at last we have to display the g option pan dot yes no message option we need to display so let me show you the complete this one after that we have to move to the next line let me move a little bit right down also after that we have to write here a is equal equals to 0 it means it that means that user selected yes in that case we have to call a method which exists in category dao so let's call that category down category down this one dot delete and we have to pass the id and after that we have to refresh the space to set visible and here we are going to write here false and after that we have to write a new manage category dot set visible and here we have to write true true let's copy these two lines and for this uh table we are done we are going to write the code for this clear so just paste that code over here and right click on format this code so it will automatically put the spaces in between lines and all things it will take all of those stuff after that we have to double click on this button and we just need to write here set visible false so it will hide that page let's save this let's open it up okay we also need to connect this page manage category with the home page so let's move to the design section and move a little bit down open manage category move a little bit up and here we have to write new manage category dot set visible and here what we need to do is we have to write here true so let's run this so here when we run it from the home page directly it will also show these buttons because if conditioned it will not work because email address is null uh okay so let's start let's run this and let's check it out it's working fine or not so let's click on manage category you can see page is visible over here let's say i'm just writing something like t and let's save this so you can see category added successfully when we click on okay it will refresh this page and the details related to product like category it will be visible over this table so let's click on okay okay it is not loaded it means that we did something wrong so let me okay let me close this let me exit this application and let me check it out or what song we did over here so okay j label component show okay so we write the code at somewhere uh wrong so just click on this go to the pro right click on this jframe okay and we have to generate even for that so event event and we have to move to the component show for that frame we have to generate the event not for any level so if you directly generate from event so it will generate for that label so that that's wrong totally so we generated event you can see the form component show event so we have to copy that code and you can see the label code just copy this and remove this one and save this and let's back over here let's paste it over here let's format this code save this and let's remove that event from like uh we created for like wrong so let's click on this remove that event okay close this save this we have to generate event from this jframe now let's test it out again so it need to be work actually so it's running let's click on manage category you can see it's visible one t but it is not bold we have to make it as bold not a problem let's try to delete this let's add one more coffee and let's save this category added successfully let's try to delete this do you want to delete this coffee category yes i want a category deleted successfully you can see it's working fine validation is also working fine so we just need to make it a bold so let me exit this application once and let's move to the category just right click on this go to the properties we have to make it as bold 12 okay just save this so this is all about manage category part of my cafe management system project i hope you guys like this video so please hit like and subscribe my channel thank you hello everyone welcome to my youtube channel in the previous video i just created this managed category part of my cafe management system project if you are not seen that video just go to the description and check out the link in this video i am going to create a new jfm for this new product so let us start with that let me exit this application let me create a new jframe over here so just right click on this and we have to click on j frame form and here we have to write add new product and after that we have to click on finish it will create a new jframe form you can see form has been created now we have to double click on this and we have to increase the sizes to 700 comma 400 okay and save this after that we have to go to the properties of this form and we have to remove min max close button so just click on this after that we have to set the location where we have to open this page so just click on this location and remove this 0 and here write 350 after that here we have to write 134 and we have to click on ok and close this after that we have to save this form and let's place here label over here and we also need a button so let's place it over here and let's insert write the name first new product after that we are going to insert a button icon first so let's go to the image and we have to select this close okay close this we have to edit this text and remove this let's decrease this to 30 after that we have to place it over here and after that we have to like we also need to insert a icon in this so just going to the icon images and after that we have to select new product so we have to select for new product so move little bit down you can see new product dot exists so click on ok and close this after that we have to increase the size of this text we will do it later after inserting the formed it after inserting all the labels and here the first field which we are going to use for name so we are getting it from user name after that the next which we are going to use for a category category and the last which we are going to use for price so let's write here price and here we are going to insert text field and let me increase the sizes to let's say we increase the size to 300 to 3 something after that for this category which we are retrieving from our database so we are going to use here a combo box because we don't need to write here text okay so let's place a combo box over here and let's increase the size to this one after we have to insert a text field over here so let's insert here and let's increase the size of this one and after this all we have to insert two buttons so let's place button one over here sorry two and at last but in this one you can see almost our gui is ready we have to do some changes over here so let's remove this let's first uh insert icon for this so just go to this one and here we have to select the image package and we have to click on clear okay close this and here we have to write clear and after that we have to here we have to write save and after that we have to insert the icon so just click on this images and here we have to click on save so we have to select this one okay just close this and save this after that we have to increase the size of this all so we need to select this one by one and we have to make it as bold 14 go to the properties of this and we have to select bold 14 okay just close this you can see size has been increased after go to the properties of this category combobox after we have to delete this all because we are going to say like insert this is from like uh by encoding okay after you can see our gui is almost ready so we first we need to change the layout so i am changing it to absolute layout after that we have to insert a label so that we can insert a image in the background and here we have to select the image and here we have to select for small small piece background image and we have to close it and we have to place it perfectly on this form and we have double click on this you can see the label is visible for this form we have to just delete that and save this after that we have to like uh you can see our gui almost ready so before that we have to change the color of this piece sorry this variables so let's make it as white so just need to click on this okay and we have to just close it you can see our gui is completely ready now now now for to store these details we have to like uh we have to create a table so let's move to the tao in that we have a table dot java here we have to and here we have to create write uh query to create the table so string and here we have to write product table table equals tables semicolon create table product and after that we have to write here and i sorry id end auto increment and after that we have to write a primary key and after that we have to write here the name bad care let's take it has 200 and after that uh category where can let's take it as 200 after category the next is price sorry so price and here we have to write bearcat 200. and save this so let me show you the complete query of this you can see uh create table product id and auto increment primary key name category verify 200 okay after that we have to like execute this so we have to just copy this part and we have to paste it over here and we have to copy this product table to here and here we have to write product product table created successfully after that we have to comment this uh this three tables actually we already created this so we have to just create the last product table so right click on this and then file uh it will create the table let's wait for few seconds actually yeah product table created successfully click on ok and revert whatever we commented over here and let's check it out our table has been created or not you can see a product table has been created let's see the description of product table and here you can see id name category price you can see everything detail related to that over here after that we have to move to this and to insert uh we have to generate the getter setter for this details so first we are going to create here like a table so it's not table okay we already created the table so we have to create a model so just right click on this and we have to create a java class which name should be product and click on finish so here you can see we created a product table and now we have to declare few variables which we created in that table so int id after that private private string name private string category category after that private string price and we have to put semi column after that we have to right click on this and we have to click on insert code and we have to click on getter and setup so after that we have to select all the fields and we have to click on generate it will generate the data setter for that you can see it's generated now save this and close this product.java after that we have to move to like uh this one dao and we have to create it out so just right click on this and create a java class and here we have to create the product tau so whatever the things related to like we are inserting updating whatever things we are going to write the query over here and we are going to call that query from our add new product and other pages too so let's click on finish it will create a product down after that first thing is we have to import import models so model dot and after that we have to click on product and we imported this and after this we have to like create a method so public static pick white save and after that uh like it should be void because we are going to insert the details so in that case we don't need to return anything that's why i'm making it as a void provide okay so here we have to call we have to get the product details so product we are getting that and product okay and after this like we have to write the queries string string query equals to in in doubles we have to write the query insert into product and here we have to write the names so name of the column so id is automatically generated that's why we are not writing over here category price this things and here we have to write the values and let's say one single doubles plus this and here we have to write product product this product this one uh dot get name after that then same way we have to copy two more times and we have to just change the name so let me paste it to one two and we have to change the name only so get we should be here we have to write category after at last get dice this one so you can see the complete query uh it should be insert into product name category price values product dot get name product dot get category product dot get price after that we have to execute it right so we are going to call the db operation operation method and in that we are going to pass this query to set data and we have passed the query and here we have to pass the message whatever you want to display so product product added success fully and after that we have to save it so you can see uh the product dao part is also completed for this add new product so we just need to close this for now and let's move to the add new like add new product so first thing is like uh whenever the page loads so save button should be disabled so we have we are going to write here okay few more things we forget to do like we just need to change the variable name so txt name and uh here we have to change the variable name so txt category and after that we have to write change pxt price and we have to click on ok and save this and we also need to change the variable of this one so btn save okay and we also need to change this so btn clear okay and save this after that we have to move it uh back over here so btn save we are going to call this and dot set enable enable we are going to make it as false because whenever page load it should be disabled after that we are going to write the code to enable that button so let's move here so public void validate fields fields and here we have to just uh write few line of the code string name equals txt name like dot get text this one after that string string price equals txt price dot get text txt text and after that we have to write if name name dot equals this one and we're going to pass check it like it should be similar to this so in that case we have to like uh enable that button so let's see right here price for price also price dot get text sorry so it should be equals and here we just need to write this btn save dot set enable and here we have to write true and else in this condition we have to disable that button so dot set enable and we have to write here false so in this way we are going to enable and disable buttons so we also need to call that method so event he released an event event he released so in both uh like uh event we have to call the validate field method and here we also need to write validate field method and save this after this the next thing is we have to like uh we have to load the details in this combo box right so for that we have to generate events like whenever this pages get loads so in that case we need to call that so we have to click on this j frame not on any label or anything we have to click on this j frame right click on this and generate a like a component show event this one you can see form component show event in this uh we are going to like uh array uh we are going to load that data okay adding list this one and this should be okay whenever we write this it will import few things you can see java util package is imported okay after that we have to write here we have to write here category so we did till now we did not imported that so we have to import that import so model dot category and uh we also need to import few more things import import model dot product this one also ah after that uh let's write here category this one and after that we have to write here list equals to we also need to call the category dow actually to get the details related to category so import like dao dot category down this one and after that category dao category dao dot get all records we have a method in that you already created in the previous video if you are not seen that video just go to the description and check out the link after that we have to call the iterator iterator this also belongs to like uh like util package actually so let's uh all that delete this and call the iterator iterator you can see after that we have to move back over here and here we have to write category this one after that we have to write here i t r equals to list dot iterator and after that we have to write y iterator dot next in that case we need to like uh add the items so category category this one category object okay so category object equals to obj first to itr dot next and after that j okay takes t uh we have a category this one dot add items this one and here we have to write category object this one okay sorry this one first one dot get name and we have to save this okay we are getting some kind of okay it's automatically gets removed actually in this way we are going to add like a category name in this combo box after that we have to write the code like whenever we click on save button so just like double click on that you can see it generated a event after that we have to create the object for product table and here we have to write product equals new product and after that like we have to write product dot set name and here we have to write txt and name dot get text this one product dot set category and txt category we are going to write here dot uh dot get selected uh item and it should be in form of a string so i'm just writing here a string and save this after that after that we have to write here uh product dot set price and here in this at this place we have to write txt price dot get text and after that we have to call the product down product tau okay till now we did not imported that actually so we have to import that so import dow dot product dial and let's uh get back over here and after that we have to save and in this we just need to part pass this object you can see this one after that we have to write like we have to hide this page and we have to uh like again show this page so new add new product dot set visible and here we are going to make it as true and save this after this like we have to like write the code to clear this field so i'm just going to copy these two lines of the code and paste it over here let's format this and after that we have to write the code for this line so i'm just writing here set visible we are going to hide this page so false and save this so let's uh we also need to connect this add new product page with the home page so move to the design section and just double click on new product it will generate a new event and here we have to write new add new product dot set visible and here we have to write true so now now it's time to test it it's working fine or we are getting some any issue so let's open this and uh yeah we have to click on new product so you can see a category name is visible so let's add some more category and let's check it out it's working fine or we are getting any error so so i am writing here soup let's click on save category added successfully so click on ok you can see uh you can see the t and ship over here so after that click on new product we can see the two categories it means that it's working fine so let's click on like uh this one should and let's write the name over here so bean soup and let's set the price to 200 you can see it's also working fine like whenever we did not write that like price it will uh disable this save button let me click on product added successfully now let's write something and let's write here price and let's try to clear you can see it's also working fine so let's close this application and let me check it out like uh uh it's visible like this are in our database or not saved in our database or not so let's open this you can see product id one being category shoe price 200 is here so this is all about add new product part of cafe management system project i hope you guys like this video so please hit like and subscribe my channel thank you everyone welcome to my youtube channel in the previous video i just show you this new product part of our cafe management system project if you are not seeing that video just go to description and check out the link in this video i'm going to create a new jframe for this view indeed and delete product part so let us start with that let me exit this application and let me create a new jframe for that so right click on this new jframe form and here we have to write the name so view edit and after that we have to write delete product and after that we have to click on finish it will create a jframe you can see page has been created first thing is we have to make it as 1366 comma 768 screen size after we have to save it now we have to insert a label first here and let's rename this view edit and delete product and after that we have to increase the size uh like we have to make it as bold 14 hold 14 okay and we also need to insert icon so let's select move here images and here we have to select view edit so we have a image with this name so let's check it out yeah so we have to select this name view edit delete product dot png image and let's save this now that we have to insert a button to close this form so let's go to the properties and let's insert image in that first images and let's select that uh close dot png image after that we have to close this and let's read the sticks and remove this and let's decrease this to 30 and after that we have to place it the corner of this page and save this after doing this uh we have to move little bit down of this page okay let's check it out the screen size 136 768 it should 768 so it will cover my complete screen after that like we have to move little bit up below this we have to insert here a label and we have to rename this and here we have to write id so first label which we are going to display for the id after that the next level which we are going to display for name uh after the name next level which we are going to display for like a category so here we have to write category after category the next level which we are going to display that is for price so price okay after that uh like we have to insert one more label here actually or to display the id so let's place here to dash now let's write here 0 so it could be visible after that we have to insert our fields according to that let's say first okay it's generated the event actually we clicked on that so not a problem we are going to use that event uh let's increase to 300 up that for next category we are using combo box so we have to select the combo box and we have to place it over here let's increase this to 300 after that we have to like uh need a text field text field and it should be 300 after that we have to insert buttons over here so let's place button one by one and let's say place last button so this button is for the clear so we are going to write here clear and we are going to insert the icon for this so lets uh select the images and after that we have to click on clear.png close this after that we have to write for delete so delete and after that we have to go to the properties and we have to select the image for this one also and let's select the delete dot png image okay close this after that we have to edit this text and we have to write here update and let's insert a image in this one also let's select uh images and here we have to click on move to the save this one save dot png okay close this you can see form has been created let me edit this text remove this by default text and we also need to remove this category items so let's go over here mod here create this all and click ok close this save this after that we have to select this all and we have to increase this to make it as bold 14 actually hold 14 okay just close this and move little bit left actually of this one let's increase the size of this one also what okay uh i think it's move little bit right yeah okay so let's increase by this side and decrease by this side it will fix it now after doing that we have to insert a table so let's uh insert a table here so let's place it over here and let's save this and let's minimize this one so that you can see at once complete form and after that uh i think it should be like it should be below this okay after that uh let's say the table content actually so we need a full column so let's id here we have to write id after that the next one is for name and after that the next one is for category 3 and the last one we have here is price after that we have to close this and okay one more thing we forget here like we have to remove all the raw so just uh click on close after that we have to go to the properties of this and we are making it as bold 12 okay close this you can see our form has been created our gui is almost completed now let's change the layout to absolute layout actually after that uh let's uh insert a label here and let's go to the properties and after that we have to insert a image so this one is icon and we have to click on images and here we have to select for full page background on png image so this one click on ok close this let's place it completely on this page and let's move little bit right double click on this page you can see the label name is visible so delete that and save this page okay so you can see our gui is completed you can see the complete uh okay one more thing we forget here we have to change the like uh this one color to white actually so right click on this by selecting all this and after that we have to click on over here and we have to click on this and click on ok close this you can see color has been changed after that we have to save this so after doing these things first we have to like uh create few methods in product tau actually like whenever we click on update it should call that method whenever we delete it will call that meta and like we want to load the category we want to display the tables we everything we need to call methods so for category we already have a method so leave that for let's start with update and other stuff okay so let's move to the dow and in that we have a product.java class and here we have to create like a method which should return add a list so static array list this one so it should import from java util you can see it automatically imported that after that here we have to write actually product which we because we are going to import okay it automatically have that after that we have to write a get all records and after that we have to like uh it will show either because we did not return anything till now so we are going to create a add a list add a list with the like uh product type and in that we are going to set the values by extracting it from database so let list right here add a list equals a new array add a list and after that we have to like return right so let's write a return adding list you can see it has been removed but right now we did not connect it like we did not getting it from database it should return null right so let's write code for that so i'm just writing here try catch block first catch block first and here we have to write exception e and here we have to write g option tan let me move a little bit down g option pan pan and this one dot show message dialog null and here we have to write e okay so after trying in the try block we have to like call the result set okay so result set actually we have to import so it's all that option is not visible so we have to import java dot sql dot asterisk and let's get back over here result set you can see visible after that we have to write rs and here we have to call the db operation db operation method and that we have a get data and in this we have to pass the queries so here we have to write select star from product and here we have to write y r s dot next and here we have to like uh call right here we have to create the object of product table product name new product and this one and after that we have to set the product details so product dot set id and here we have to write rs.get end so first we are going to get the id so here i'm just writing the id the name of that right so product dot set and after that we have to set the name so rs dot get string and we have to get it like the name so i'm just writing here name product dot set category rs dot get category here okay so it should be sorry it should be a string and in between we have to write here category category after that at last i think we have to add product dot set price and here we have to write rs.kit a string string and here we have to write price and after that you can see we are like we have to add like in the added list this product we have to pass that so here we have to write adding add a list dot add and we have to write here product you can see automatically taken that product so in this way we are going to add like uh like adding this in this add a list we are going to add the product object of that product so let's start so after that we have to create few more material over here so let's create that like uh let me move to the view date so this that method which we are going to use to display the details related to product in this table after that we are going to write the code for update part after that we are going to write the code for delete so let us start over here not over here actually uh we have to move to the product tao actually so here we are going to create public static we don't need to return anything so we have to write here wide update update sorry update and here we are going to take a product type of okay uh input and in this uh we have to write create a query actually string query and here we have to write update product set name equals to single double plus plus product dot get name actually after that uh let's place the semi column at last after that let's copy this part and uh let's place the comma here over here one and two after that let's check uh change that this one so first we have to change it to the category category okay after that we have to check uh change this gate category actually and let's move a little bit right also so after that category we have to write your price and we also need to change to git price and after that we have to write here after this we have to write like a via id is equals to single again same plus plus and here we have to write here product product dot get id this one so let me show you the complete this one so you can see we have let me show you update product set name a product dot get name category dot uh like product dot get category price product dot get price where id product dot get id after that we have to pass this query to db operation set uh like method we have dot set data and this you can see we pass the query and we also need to pass the message so product updated success fully and save this let's copy this line of the code uh let's play okay we don't need to copy completely actually so leave it static white and here we are going to write it for delete and let's uh right here we are going to take the id only to delete it right so i'm just writing here string id and here we have to write the query actually so string query single after that we have to write here uh delete rom and product where id is equals single double plus plus and here we have to write id so after that we have to like again call the db operations this one dot set data and we pass the query and we have to pass the message to intervals we have to pass the product deleted success success fully and save this you can see we created here theme three methods uh let's close this and let's get back over here in the view edit and delete product this one ah let's move to the design section and after it's first thing is we have to hide these two buttons update and delete not hide actually we have to disable these two buttons so let's move here and in in this place we have to write okay we also need to change like a variable name so let's change this one to btn and here we are going to write btn so update and after oh okay it should be actually uh txt name okay and uh let's uh we have only one combo box i'm going to leave this now as it is let's write here txt price okay let's change the variable name so btn dot update actually and btn btn delete okay uh let's uh change the variables for this one btn clear let's click on okay and one more variable we need to change it so lbl label and here i'm going to write id and we have to click on ok because we are going to set the id right so we change the name according for that actually so one more thing we forget over here like we did not remove mean max and close button from this form so open this navigator and we have to click on this one jframe actually after that we have to click on right click on that actually right click on this go to the properties and we have to click on this and decode it and we have to close this and save this page so it will remove mean max close button after that we here we have to write btn update this one dot set enable and here we have to write false and after that we have to write btn delete actually and this one dot set enable and here we also need to write false after this like we have to validate the buttons so right according to text so in that case we have to create a method over here actually public void validate and here we have right field and after that here we have to like uh create a string string name txt name dot get text actually and after that we have to write here string and here we have to write price txt price dot get text this one after that we have to write a string category and here we are getting it value from combo box so i'm just going to write a string type j combobox dot get selected actually selected item this one and after that we have to write here if name dot equals is not equals actually uh to this and and we are checking that condition and like a price dot equals not equals and uh and category this one category is not equals to actually not equals to null in that case we are going to button update dot set enable actually and we are going to make it as true and in else condition we are going to make it as button update dot let me move a little bit like up set enable and we are making it as false okay let's save this after this we have we have to call this method so let's open this and let's generate event for this okay so this event should be not there actually so let's remove this event first because we write if we generated it okay so it should be event key released and it should be like event key released and we're going to call that method actually validate fields and here we are also going to call that validate fields method let's save this okay uh it get in like okay so after that like we have to write the code to like whenever we click on update it should call that uh like method which one metered actually let's open this so it should call this update method and we are going to pass a product object so let's get back over here and let's generate a event for this update button so you can see let's create a object first product product and here we are going to write new product actually and after that we have to go right like we have to get the barrier like id right so it should be id it should be into type so we have to convert like uh text into integer type so integer dot parse and and here we have to pass the integers to lbl level id the variable we have dot get text actually so after that like uh we have to set here product dot set id so i'm just going to write a id you can see after the same we are going to set for others so set name and here we have to write the xt name dot get text actually and after that product dot set category actually and in this we are going to write a txt not dxj actually we have to like get it from combobox string j combo box one dot get selected item this one after that we have to write a product dot set price this one ext price dot get text this one after that we have to call that product uh like uh tao so we have to import it manually actually so here we have right import import and here we have to actually write import dow dot product now actually and let's uh move again back over here so product down product dao dot update and in this we have passed this object okay so after that we have to make it a state visible hide this page and write here false and we have to make it as visible this page so view indeed update this one set visible and here we have to write here true and you can see update part of this button is done so but like uh till now we did not uh loaded any reals in this after that we also did not generated the click event also so let's do one by one actually so let's uh like now we are going to write the code for this like we load this page right not load this page actually we are just adding the details for this table so let's uh let's generate an event for that actually so click on this and we have to click on jframe form event and we have to move to the component show you can see here you can see form component show event so in this like we have to import few things so default table model it should import you can see and it should import it from here input java x swing table default model and after that we have to write here dtm equals and here we have to write default actually default default model again and here we have write j table one dot get model this one and after we have to create the array list actually add a list and this one and that should be a product type actually so product and here list equals to product dow dot get all products which we are going to call it and after that to extract the value from that we have to call the iterator so it will not import it uh yeah able to import it so let me show you from where we imported that java util iterator okay after that it created it should also a product type actually product let's write here idea iterator and list dot it like here we have to write iterator this one and by iterator dot and here we have to write has next in that case it will uh the loop will work and iterator dot has next always return true false right so just check it out once yeah it's a boolean type so it will return true false okay so let's uh write here product and here we have to write a product object equals iterator dot next actually let's save this and let's write here dtm dot add raw this one and here we have to write new object actually and remove this and we have to start the bracket and here we have to write product obj this one dot get id the same way we are going to import for others so get name name product obj dot like uh with the last after name we need for the category it category actually and at last product obj dot get price the last one so let me show you the complete line actually you can see this one after that let's move to the next line actually so here we have to write here okay it should be the complete line actually so in this way we are going to just like load the table details after that like whenever any mouse like uh clicked on a raw it should like uh set that value in this field so let's write code for that so first we need to generate event so mouse click even we have to generate this one mouse clicked event and in this this event first we are going to get the index so in index j table 1 dot get selected raw actually and after here we have to write a table model this one table model and the important table model from you can see java x swing table table model let's get back over here and after that we have to write your model equals and j table one dot git model and after that we have to like get the values so string id model dot get values and at index we have to leave it because we have a variable and in this position we have to write 0 because at 0 index we have a like ids of every right and it should return to be a string type that's why it's showing the error so the value of this we are going to set in the label id and then that's check text and here i'm going to write id actually after that the next variable which we are going to set it so string and here we are going to write name pulse model dot get and here we have to write git values this one index and here this should be one dot to string type after we have to write it txt name dot set text and here we have to write name and after that the next is for the category actually it's a string category model model dot get values and it should be index and here we have to write here 2 dot 2 string and after dx okay we have to like uh we don't need to set it for now right now we will add it later actually uh let's write it for another variable let's let's copy this line of the code let's paste it over here let's change to category to price actually let's change to this one to three and here we're going to set the for txt price dot set text and here i'm just going to write your price actually save this now now we have to like uh we have to enable two buttons actually whenever it click it should fill all these details right so it should be like button should be enabled so btn uh like uh we have to call the update button dot set enable actually and here we have to write true and after btn and we have to write delete actually dot set enable and here we have to write true let's move a little bit up actually after that the first thing is like whenever anyone click on any raw right so the category will reset and when you click on another raw it should like the category details should be changed right so in that case we have to like remove all the details from combo box so here dot remove all items you can see this one option we have to select that and after we have to write here add a list actually and we have to extract the values for the category okay this this one and it will import automatically the category category list equals to category tao actually we have to import it will import automatically get all records after that we are going to call the iterator iterator this one and that should be a category type it should be category type and here going to write a category iterator equals category list actually this dot iterator and here while uh category iterator dot next in that case we have to loop value work and here we have to write actually category type of object we have to create actually so it should category and category equals okay it should be category object actually obj equals and here we have to write category iterator dot next this one and in this like we are going to match it like ah the first like when we select any raw it should be some value here so we are going to add that value first after that we are going to add for others so let's write here first thing over here first jcombobox dot add item this one and here we have to pass the category which variable which created over here so let's paste it over here so for the first item whatever the category actually would have after we are going to match like the same category should not repeat so in that case we are going to ignore that category so i'm just writing a category obj dot get name should dot equals and it should not match with the category actually this category should not match the value of this one okay so in that case uh like we have to call the g combo box g combo box dot add item this one and here we have to pass the category obj dot get name and save this so in this way we are going to like whenever we click on any draw of the table we are going to display in the particular fields and here we are going to set the ids right so after this the next thing which we are going to do is like whenever we click on that delete button so we are going to write the code for that so just click on this delete button after that here we have to like hint okay first we have to create a variable here a string id so label dot our get text actually and after that end a equals to g option pan dot show confirm dialog this one and here first we have to pass the null and put the semi column at last and let's remove this and here we have to write here do you want to delete uh this product uh this pop-up message which you will be visible to the user select and here we have to set the option so here we have to write g option dot yes no okay it should be yes or no option this one select this and let me show you the complete line after that we have to check like whether the user selected yes or no so we have to check if e is equal equals to zero it means that user selected that yes so in that case we need to delete it right so we are going to call the product dial product dow and in that we are going to call the delete and we are passing the id and then to save the very well we are going to hide this page false and we are going to show the new page so let me write here view date dot set visible and here i'm going to write here true okay so after this like we have to write the code for the killer so let me move a little bit up let me copy this line of these two lines of the code actually okay this tool lies on the code and paste it over here and let's format this so it will automatically take it off all the spaces we need to like enter after that one more thing we forget for this button so double click on this and here we just need to write set visible and here we have to write true sorry false we have to write here let's save this so we also need to connect this page with home page so let's move to the home page and design section let's move here and we have to double click on this view we need delete product part and here we have to write new view this one dot set visible and here we have to write true actually so let's run this and let's check check it out it's working fine or we are getting any issue and let's run this let's click on view delete and uh product actually so we have only one product you can see that visible over here let's click on this you can see it's working fine actually you can see it's soup so the first option which we are seeing over here is so let's uh make it as 2000 actually let's try to upgrade this update products product updated successfully means that it will work you can see it's working let's add a new product here in d section so here let's add a black tea let's make it as 20 and let's save this so product added successfully so here i'm going to move over here let's uh make it as a let's write here white tea actually and let's make it as soup and let's make it at 200 and let's try to update this product updated successfully so you can see it's working fine you can see uh let's check it out for clear you can see killer is also working fine so let's check it out for like delete is working or not so let's click on delete do you want to delete this product so let's click on yes you can see product deleted successfully message click on ok you can see that product has been removed so you can see if you uh like a view edit and delete product part is working fine so this is all about this page i hope you guys like this video so please hit like and subscribe my channel thank you hello everyone welcome to my youtube channel in the previous video i just created this view edit and delete product part of my cafe management system project if you are not seen that video just go to the description and check out the link in this video i'm going to create a new jframe for this verify user so let's start with that let me exit this application and let me create a new jframe so here we have to right click on this package and we have to click on jframe form and here we have to write verify users and after that we have to click on finish so it will create a jframe and we are going to increase the sizes to one three six six one three six six comma seven sixty eight after that we are going to remove mean max close button so i am going to click on this check box and we have to click on ok and save this after that we have to insert a label first so let me edit this text and here we have to write verify users and after that we have to like insert a icon in this so i'm going to select this images and here we have to select verify user so we have to move it over here verify user.png image and after that we are going to increase the size of this one so i am making it as a bull 14 okay close this and after that we have to insert a button so let's place it over here and insert the icon for this so images and here we have to select the like close dot png image okay close this we did this text remove this and let's uh decrease the size to 30 you can see 30 right now after that we have to place it over here and let's minimize this and let's make it to the center of this page after that like we have to search right by you email address so we have to place a level first after that we have to write search and here we have to place a text field which will accept takes text now let's increase the size to 254 edit this text and remove this and just change the variable name so txt txt search okay and save this okay it should be email address so it should be like uh it should email and okay after that we have to increase the size right so we have to go to the properties and we have to like increase the size to do bold 14 okay closes and after that we have to insert a table so let's move to the swing control you can see at last we have a table option so just drag and drop a table and uh let's increase the size to this size after that we have to make it uh fully of this frame almost and let's move increase the size of this side also after that we have to like increase the bottom too but we also need to place a level right here so let me insert a label here and here you have to right click click on draw to change status after that let me like increase the size of this one so go to the properties and we are going to make it as bold 36 ah not bold actually we have to change to this one okay close this and let's place to the center of this page so yeah it's almost center and let's increase a little bit in size form it make let me make it a little bit down also save this you can see almost our gui is completed we just need to make changes in table and we have to insert an image in the background so let's do that so first we are going to change the table content so click on table country right click on that after that and first thing is like we have to insert for id id after that we have to change for like name after name the next one we are going to change for email email address and after that we have to like display mobile number while number and after that we have to insert for like we have to display address and after address the next one is for like we need two more so security question question and at last we need to display status after that like we have to remove the raw so just click on this and after that we have to close this you can see id name email address mobile number address security question status after that we have to change the layout to absolute layout and we have to insert a background image so let's select this one images we have to move to the images package and full page there's a full page background.png image so place it and place it perfectly on this screen now let's click on this and you can see the label name is visible so just delete that and save it and after that one more thing we need to change it actually we have to select this this move a little bit down and we have to select this and right click on this and after that we have to change the color right it should be white so click on ok close this you can see the color of this is also good change so you can see our gui is almost uh almost ready yeah it's completely ready actually so after this like what we need to do is we have to like uh write some method to load this data right so we need a method we need to create the method so we have to create that method in like user dao because we are extracting uh details from user dao right so here we have to create a method so here we are going to write public static and here we are going to return a add a list add a list actually and here that list should be user type and get all we are going to write here the very like method name so get all records and in this we are going to get the email address like we want to select by you email address so we are going to use uh that uh this method right so we are getting here i think we we're not returning anything that's why we are getting it up not a problem so after that let me know a little bit of this one and after that we have to create a area list here too and that should be like user type user and here we have to write addy list equals new array add a list this one and after that here we have to like uh we also need to return right so it either will get removed so return add a list you can see it has been removed now here we are going to write try catch and we are going to call the method to get the details of user so here we have to write exception e and here we also need to display so here we have to write j option pan g option pan dot show message and it should be null first and after that we have to display here e right after that in try catch block uh like we have to like write here result set this one rs goes to db operation we have to call the dp operation we i already show you everything related to db operation in that we are going to call git data method and that we are going to pass a query so let's write the query select select start from our user view email email like it should be like like if uh okay it should be like uh like whatever we want to search let's say we want to search sort of or at the gmail.com so if we enter yes so it will show all the related to yes in that okay so let's uh right here uh percent and hey it should be like this and after that it should be like doubles and plus plus and here we have to write email and it should also end with this star uh this one sorry percent now so whenever any uh details are like user selected we need to like write the we need to return the users right so here we have to write rs dot next this one and here we have to set the user so user user new user we are going to create the object and here we have to set user dot set id this one and here we are going to get it from db so get and sorry get id it should be id okay it should be get a string actually a string or hint okay i think i write something wrong so it should be in and here we are going to write here the name of column so here we have to write in doubles we have to write id after that user dot uh set like uh set name so here we have to write rs dot get a string and in this we have to write name in the same way we are going to write for user dot set email and and here we have to write rs dot uh like get string this one and here we have to write email and in the same way we have to write for others too so after that user dot set and here we have to write mobile number so rs dot kit uh is like a string and here we have to write the column name y number and after that uh the next one is for user dot set address and rs.kit string and here we have to write address and after address user dot set security question and here we have right rs dot get secure sorry get a string actually get a string and here we have to write security question t question and after that at last user dot set status actually and uh in this status we are going to write here rs dot git string and here we have to write status and after that we have to i add this in add a list so add a list dot add user okay after that like we also need to return so we already returned that so it will call this and after that it will return add a list okay so now so after this like we have to again back to verify user this one page and we have to move back over here and we are going to create a method over here also uh like whenever we anyone search then this method will call and uh it will also load whenever the pages will be load okay so get all records and in this we are going to pass the string string email address and here like uh we are going to all the default table model this one uh it should be from input from this one you can see and here we are going to write dtm equals to here we are going to call the default default table model this one and after j table we have table one so after that get model this one so dtm first we are going to remove all the raws actually so that's why we are setting the raw count should be zero so in that case it will delete all the raw from that table after that it will load new data okay after that we are going to call the error list actually it should be like import yeah so for that we imported this util package and here we have error list so after that we have to write a user and it should be list type that's what i'm writing here list after we are going to call the user dial this one and in that we are going to call this method right so we have to import it manually actually import tao dot user dao this one and here we are going to call that user tao dot and here we have to call git all record this one and we are going to pass that email address and after that uh okay we are getting here actually it's not imported automatically so we have to write import model model this one and we have to call the users type and you can see either get removed now the next line what we need to do is we have to call the iterator so it should call iterator this one yeah like we can call this one data from util and it should be a user type and after that ipr data list dot like a iterator we have to write this while iterator dot next we are going to call that okay and after that we have to create a object user user obj obz equals to iti dot next and if like we are also checking the condition like here we are displaying it uh like all the details right so it will also show this admin details so we don't want to like uh the for the admin to change his own status like if we make it as false then he is not able to login it again right so in that case we don't need to actually allow them so for that here we have to write user obj this one obj dot get email this one we are checking dot equals equals and here we are going to write the same email address which we are right over here this one email address okay so i'm going to copy it from here and let's paste it over here doubles after that like whatever the user you want to make it admin it should same here and here for now after that like uh in if condition we have to write up like we have to set the details right so here we have to write dtm dot add draw this one and here we have to write new object this one delete this and here we have to start the bracket and user user obj dot get id this one user obj dot get name user obj dot get uh email address after that user user obz and dot get like mobile number user obj dot get address this one and after that user obj dot like security question this one we have to select okay it should be gate right so get security question and at last we have user obj dot like uh get status get status this one so let me show you the complete actually whatever we write over here so dtm add raw new object user dot get id name email address mobile number address and after security question and status that's it after this it will like we also need to call it right so whenever this page load in that case we have to call it so let's uh okay like uh let's generate a event so open the navigator move to design section and click on this you can see we have a jframe so click on this right click on this and uh event component show okay okay i generated the wrong event actually it's a resize actually so event component show and again move to design section and remove that event actually go to the properties and event section you can see resize just remove this okay close this and move to this section and you can see we have a form component show event and from here we are going to call that method actually get all this one and we are going to pass nothing over here this one so it will consider it as string but it should be nothing right so it will in that case it will load all the users like all the whatever they exist in our database so it will load all these two email address actually this two-way okay so after that let's open this and let's generate event for this one and let's write here set visible and here we have to write false okay after that like we also need to do one more thing actually so we also need to generate this event right so event key release actually and in that case we also need to call the method and get all the records actually get all the records and here we have to pass the email address so yeah okay from where it's taking the email address let me declare an email address hell okay so it should be like uh we're getting okay it should not a so delete this for now okay let's create a variable string email equals and here we have to write txt search okay it should be like a txt email i think we created yeah this one and dot hit text actually we have to call this and uh we have to pass this email address to this one so whenever this will call it will remove actually all the raw from our table and it will set here it will remove all the raw and it will add whatever according to search right so it will work like that so after this like the next thing is what we need to do is like whenever any one user click on raw uh it should ask for like you want to change the status right so let's start with that okay so we have to generate an event actually so j table event uh like mouse clicked event we are going to generate that and in this we are going to write end index equals to j table 1 dot get selected actually is selected raw this one and after that table model this one we have to import actually so it should be import from java x swing table so this one and model equals j table we have to call the g table one dot kit model this one after that we have to like write the e get the email address so email address equals to so model dot get values at and here we have to write the index so it should be index 2 right so zero one two so we are going to get the email address from there after that here okay we are getting some kind of error actually okay it should be like uh it should this one should be index actually and at this place at this place actually we have to write two and it should be two string so you can see either has been removed so string status equals and model dot git values at and here index and it should be 6 dot 2 string and after that like we have to change the status right so if the status is equal to true then we have to make it as false and if it's false then we have to make it as true so status uh like dot equals and in this we have to check it like if it is true in that case like we have to change the status right so status equals to we have to make it as false and else condition we have to test it we'll change it actually equals and here we have to make it as true and after this like we have to also show the yes or no option like you want to change or not so end a equals to j option tan dot show confirm dialog and here we have to write null and here we have to display the message right so just leave this do you want to change the status of in doubles we have to like plus plus and here we have to write email address so it will display that email address after that we have to display the top message to select and we also need to ask for yes or no option so g option pan dot yes no option this one and after that like here we have to like write if a is equal equals to 0 and in that case it will call a method actually till now we did not created that method so we have to move to that user down page and here we have to create one more method to update so let's create here public static void okay so it should be like void after that change status i'm going to write the method name and here we are going to get the two like parameter that is email address actually and another parameters status which we are going to update right so after that here we are going to write the queries a string query equals and here we have to write update user set status equals and single double plus plus and here we have to write status and where email equals like single double plus plus email and in this we have to pass the query actually so so db operation dot state data and here we are going to pass the query and here we're going to pass the message we want to display so status changed success fully after that save this and we are going to call this method from here so let's open uh like uh let's write here like uh user dao this one dot change like here we have to write change status and here you can see automatically taking the email address and status and here we have to write set visible false and new visible verify users start set visible and true so let's save this you can see our coding is done for this page so we also need to connect this page with our home page so just move to this section and let's move over here and let's double click on this and generate an event and here we have to write new user sorry verify user verify user dot set visible and here we have to make it true so let's run this and let's change it test this out that it's working fine or we are getting any error so let's click on verify user okay it should be like search should be a little bit left not a problem but you can easily move it left right whatever you want you can see we are able to see the two users this one is of and ankit gmail.com let's change the status let's click on this do you want to change the status for ankit gmail.com i click on yes it will show a message status change successfully let me click on ok you can see it get changed to true so let's check it out it's like one more thing we forget here let's write here unkit you can see it changed okay one more thing i forget here we also need to make it as bold not a big thing actually so let's close this and let's do that first okay after that we will going to try to log in so let's move to the you this page and let's go to the properties and let's make it as bold 12 okay close this save this actually after that let's move the this home pin listen it from the home page and uh we are going to log it out actually and here we are going to you login with unkit gmail.com one two three i'm trying to login it actually so you can see we are able to log in because i change the status to true so let's log out and just try to log in with the code gmail.com123 password i think so you can see we are getting the wait for admin approval it means that our verify user is working fine so this is all about verify user part of my cafe management system project i hope you guys like this video so please hit like and subscribe my channel thank you hello everyone welcome to my youtube channel in the previous video i just created this verify user part of cafe management system project if you are not seen that video just go to description and check out the link in this video we are going to create a new jframe for this placehold order so let us start with that let me exit this application and let me create a new jframe over here so right click on this new jframe form and here we have to write place order after that we have to just click on finish it will create a new jframe form after that we have to increase the sizes to one three six six comma seven sixty eight and we have to click on okay and save this after that uh like minimize this part so that you can see it at full screen after that we have to remove mid max and close button so we are just click on this okay close this after that we have to open this palette box okay and from there we are going to drag and drop all the things here you can see first level so here we have the right place order and in that we have to actually go to the properties and we have to select the icon so uh we have to actually import it from other package so we have to select on images and here we have to select place order you can see place order dot png click ok and close this after that we have to insert a button so here i'm going to place a button and we are going to select an image for this one too images select and this one will be close and after that click on ok and we have to close this and remove this text from this field and decrease this to let's say make it as 35 okay and let's place it over here after that we are going to insert one by one all the fields so let's place it over here the build i uh this one is for bill id bill id and here after bill id we are going to insert one more label to display the bill id so let me rename this dash dash for now so that at least you can see after that we are going to write here customer details right so customer details and after that we are going to get the name so just right click name and after that we have to insert the text field so just select text field and drop it over here and let's increase the sizes to 250 and after name the next label will be for mobile number while number and after that we are going to place a next text field so here we are going to place it and yeah after mobile number the next we are going for email address so email and let's draw drag text field again and let's remain on remove this by default text from all the fields and the first thing is uh what we are going to do is we have to select this all and let's increase this to bold 14 right click on this okay sorry i just select it in this way and right click on this and just make it as bold 14. okay close this and save this after that the next part for like we have to insert is our category we have to display the product details right to select the uh select the user or admin category and after that we have to display combo works from there like user can select like different category so i'm going to select this one combo box and i'm going to place it over here and let's increase the sizes to 250 and let's uh remove all the items from this let's select this and delete this all okay close this and after that we have to like um one more level we have to insert and this one is for search and for this we are going to insert a text field so let's place it here and let's increase the size and let's remove this text to and after this we have to display a table actually here so let's uh here you can see at last you can see the table option so just place it over here and let's move little bit right and yeah perfect and let's decrease the sizes to this one and after that just go to the table content and first thing is we have to remove this all so column count should be zero sorry the column should be one and i think this one is name and let's click outside of okay and after that we have to click on draw and we have to remove actually raw all the wrong and after that we have to click on close you can see and after doing this view again we have to select this all fields and we have to make it as a pulled 14 bold 14 okay closes now let me check the size of this form yeah 136 yeah it's perfect so now so next thing is uh we have to let me move a little bit right okay so next thing is we have to display here the product details right at this part and bottom part we have to display the selected product right so let's place a label here first so let me insert a label here and here we're going to write rename this and let's write here name and after name we are going to place a text field so the text field here you can see and let's place it over here yeah and let's make it as 250 i'll leave it as 251 you can decrease on increase according to yours okay so after that uh the next label we have to insert is for like price price and the text field we have to insert here let make it as 251 and here we have to insert few more fields rename it as quantity okay and here we are going to use the spinner so let's place it here and let's increase the sizes to as it is okay and after that we have to insert the other labels and here we have to write total then we are going to insert here a text field text field and let's increase the sizes to this one and let's rename this all rename this remove this and save it after that here we have to insert two buttons here to first button we which we are going to use to create this fields and another button we are going to use for add to cart so let's place the buttons here and the next button here and let's write it add to cart and here let's rename this to clear and let's uh select one by one and insert icons for this so after that images select this one is for clear okay close this and select this one and here we have to select the images package and here we have to select add to cart so add to cart should be at start yeah add to cart and ok close this after uh doing this all we have to attend we have to insert a table here so let's please place it over here okay i think it's uh leave it okay let's close this for now and let's increase the sizes to seem as it is to this okay i think it's uh changing automatically so let's do one thing let's first increase the size of this all fields and we will make it as change the layout type right click on this and just just go to the properties and make it as bold 14 okay just close this and after that we are going to change the layout so set layout should be absolutely out and now let's increase the size you can see now it's not uh it's changing automatically okay after this we have to change this actually table content so just move to the call raw and just remove this all raw first and let's move to the column and here first we have to write name name after name the next price after price next we have quantity and at last we have to write total and let's close this and after this we have to insert here a grand total which is display like total amount for all the like uh product which user selected so grand total um it should be in rs right rs and after that uh we have to insert a one more label to display the value actually so let's edit text and zero zero zero let's write here for now yeah so after that we have to insert here button so let's place it over here and let's read this text and here we have to write generate bill and print and in this we have to actually insert a icon too so we have to just click on this images and we have to just move to the generate bill icon you can see this option and click ok just close this after that we have to select this all things again and not again actually first time uh let's make it as bold 14 okay and just close this it's moved okay uh we have to just select this and move little bit right and save it okay i think this one is overlapping so let me move this is little bit right now now it's looking good so here you can see almost our form has been created few more things we have to add here just a background image first let's right click on this place label and after that we have to select full page background image full page background image we have to select this one i think no not this one actually this one after that we have to click on ok and close this and we have to place it perfectly on this form and after that we have to just save this actually first uh just double click on this anywhere else any other than field you can see their label name is visible you have to press back a space to delete that and just save this after that you see the color is black but in like quick overview you see white right so just select all the fields one by one and we are going to change the color so just select it let me move a little bit right down to and we are going to select this and go to the properties and here we are going to change the color so just select this one okay and close this now it's looking good now it's exactly as you are seeing in the quick overview video so after that are doing this before like running this page first we have to connect this page with our home page so just open the home page here you can see we have to double click on this home page actually and it will generate a event so just right here set visible and we have to just write hide this page and for move to next page that one is our placeholder right so false and if we have to move to the new and here we have right place holder and here we have to write set visible and here we have to write true okay one more thing we are also storing like who created bill right so for that we also need to pass the email address correct so in this uh we are using this email right so we also need to pass this email address to this place order page so till now we are not accepting that any email address so for that we need some changes so move to the place order page and just copy this line of the code again here and just uh make it as similar to as previous and here uh what you need to write is string user email just write this after that save this and again move to the home the java page and here just passed the email address email address okay uh we are getting some error so let's check it out what's the issue string username okay it's uh s should be capital that's why it's giving us error so let's save this so i think you can see it is removed from here you can see it is also removed from this place too so now after you can see we will receive the email address from here correct and after that we are going to write the first line of the code for this one to like close this form and move back to our home page okay so here we have to write set visible and here we have to write false new home and here we also need to pass the email address to uh like back to that home page so for that we have to create a variable so public string and user let's write here a uh let's write user email user email for now and we are going to return that i'll just copy this and here just write change to email and here we are going to return that email address and dot and here we are going to write set visible and here we are going to write true and save this you can see okay we are getting some error okay it's automatically get removed now let's run this and let's check it out it's working fine or we are getting any issue like it's jio is as it is or not so here we have to write admin at gmail.com and the password is admin let's click on login and here we are and let's click on place order you can see it's perfectly as it is as shown on videos like quick overview so let's close this and right now we are getting error this email add is null okay we are returning the email address as null that's why it's giving us not a problem so leave it for now and uh now let's move uh to the create table actually so let's uh click on table and let's minimize this and here we have to write a query to create a table that's a build table actually let's copy this line of the code and let's paste it over here okay it's showing here because we already have with that variable name so let's change this to bill table bill table and here we have to write create table and here we have to write bill and idint primary key we don't want it as auto increment because we also need to display the like id and after that bill id we are installing name where as it is we have to leave it and after that uh name we are storing the mobile number mobile number where can and here we have to write 200 after mobile number we have to write email there can and here we have to write a game 200 after email address we are going to write date where can and here we are going to write 50 and after d the next total where can and here we are going to write 200 and at last created y fair can and here we have to write 200 and let's save this and let's move here again and um like we already have this this tables right so we have to not uh like create it again so just comment this all and in this we just need to pass this bill table and here just write bill table created successfully that's it and now we have to just right click and run file so it will run it actually okay you can see the message bill table created successfully so let's uh check it out i think library is running so let's stop this okay and let's move here let me show you the tables we have right now you can see it's build table and few minutes ago we have only three tables right so if you want to see the description you can see that bsc bill okay so after creating bill the next thing is we are going to create a model for this so just move to the model section and right click and create new java class and the class name should be bill and we are going to finish it and you can see build table sorry build class has been created so private end id private string name so private string mobile number private string email private string date private string like total sorry it's uh i forgot to write l private string created by and after that we have to generate the getter setters so we just need to right click on this insert code and here generate sector and getter so just click on this and generate so you can see it has been generated get a settle for this now now we have to create some dao for this so let's uh create java class here so the class name should be bill tao and just click on finish it will create dao right and after that we are going to create the first method in this is public static string and git id and here we are going to write end id is equals to 1 and writing try catch block exception and if any exception occur we have to display so j option pan pan this one dot message dot show message dialog this one null and whatever the error we have to display and here we are going to call the result set result set set this one and we have to import okay we are not able to import it so we are going to directly import java.sql i think sql dot asterisk and now let's try to import this we have option resultset and after that rs equals to db operation db operations we have to import this db operation dot get data and in this we have to pass the query so carry should be like this select max max from the id column whatever the value is max from that column we are getting it selecting that from the build table right so after that uh what we are need to do is rs dot next say have any value we have to move next that's it after that uh here we are going to increase the value so id is equals to rs rs.kit int it should be like 1 and id is equals to id plus 1 and after that we have to return actually to by converting that value to a string so return a string type dot values off and here we have to write id and at last semi column so you can see either automatically get removed because we are returning a string type of value right and after that we have to write here one more method to like insert the bill details okay i think we didn't forget to save this so just save it and move back over here and here we have to write bill sorry public public static and we are going to not return anything so wide so it should be save and whatever the value we are going to get is bill type so bill and it's showing us a error so just click on this and you can see add import from model so you can see it automatically imported this and after that we have to start the brackets and here we have to write the query actually so string type query insert query actually we have to write here so insert into bill values so the in single doubles plus plus and bill dot kit id in this we are passing the id because in every method you can see we are um getting the id right you're generating the id whatever the value is max in that id id column we are increment doing increment here and that we are going to insert it over here so after that bill id the next field is for singles tables plus plus and here bill dot get name so this option and insert the next option as it is we are going to follow the pattern so we are going to copy it uh five times actually one sorry ah sorry we have to copy this part actually one two three four five now one by one we are going to change the name so the next after name the next is for get y number you can see and after that gate mobile number it should be get email email and after get email address email address we have to get date and after getting date we have to get total fifth total and at last get created by so get created by this option and you can see our query has been completed so insert into will values bill id name while number email address ticket date get total created by that's it after that we have to move to the next line and here we have to call the db operation db operations dot sit this one method and in this we have to just pass the query and in this we have to pass whatever the bill details added success fully this message we are going to display so this two method has been created for build out now few more method we have to create it here that we are going to create uh those in our product down so just move the product down and move a little bit down and here we are going to create those methods so public public static white and here sorry not void actually it should be returned at a list and the list should be type product and here we have to write get all records by category and here i think we already created this no okay so uh on the basis of category we have to display right in the form you can see uh where is that form actually place order in this in this form you can see we are displaying all the details right product name so that's why we are using that and and here we have to start and here we have to write string and we are going to get the category name so category and here we have to write create the array list actually list of type product and add a list as opposed to new adding list semi column and after that we have to write try catch block and here we have to write exception and in this we have to display if any error occur so g option pan dot show messages dialog null and in the try block here we have to write result set result set this option and r is equals to db operations we have to call db operations dot get data this one and in this we have to pass the query actually so here we are going to write select star from product where category is equals to singles tables plus bliss and here whatever the value of the category this one guri we are going to pass it so let me minimize this so that you can see the complete square like what we are passing it over here so after that uh like we will get the value right so why are this start next this and here we are going to write product we are going to create the product object actually product product equals to new product and here we are going to set the value so product dot set name and here we are going to get the value so get a string and in doubles we are going to write here name and add a list this one dot add and this one should be product so at last we have to return this so when we return add a list then you can see automatically the error will be get removed so adding list this one and you can see it has been removed automatically okay so after this we have to write a few more things actually so on the basis of like name and category we also need to like get some values so let's uh copy this same line of the code for now and we will made some modification in this and here first thing is product and here we have to change this name so filter filter product by name we are going to write here and this will take two values actually so string string and here name and here we are going to leave it as it is this part and here we are going to write select start from product appear like let's read this part for now appear name like and in the single and this symbol after that doubles and plus plus and here we have to write the variable name so its name and we have to write category category like like sorry category should not like actually on the basis of name we are searching something so the category should be like exactly matching with that actually so in single doubles press plus and here we have to pass that variable name so category and save this let me show you the complete what we are going to pass it you can see here after writing that we are going to return the product uh sorry creating the product object product rs.get name and add a list add and we are going to return it okay so the first this one will return all the categories according to categories it will return the value and this will return on the basis of category we are going to search anything let's say we have a category t so i just want hot b so we just need to write hud so it will search according to that okay so after this at the next method we are going to create it is like git let me create it actually and that will be public static product actually it will return actually product which we are going to display at this field so let me open this this places this will be visible okay so let's get back over here and here we have to write get product by name name and here we are going to write a string name and in this uh we are going to write actually first we have to create the product type of object so product equals to new product and after that we are going to write try catch block here we have to write exception and in this uh we just need to write j option pan dot show message dialog and here we just need to write null and whatever the exception we will got we have to display and in try block result set rs equals to db operations dot get data and here i was writing uh sorry we have to write the query select to start from product where name equals to and in singles doubles plus plus and here we have to write name we'll search okay we are getting some kind of okay we did not place semicolon at the end that's why it's giving us here so while rs dot next and here we are going to write product dot set name and here we are going to get that value so rs.get string and here we have to write we are getting the value as from 2 that's what we are writing as true so after that we have to write product dot set price okay it should be rs.get string and here we have to write 4 here we have to write four okay and product dot set category rs.gate string string and here we just need to write three so after that we will also need to return so here we have to just write return and here we have to write product and after that we have to save this now now let's move to the place order gui and here first we are going to change some variable names so let's change this to uh like change variable name and here we have to write txt customer name and just copy this and ok and after that change variable name so here we are going to write mobile number so mobile number and after that we are going to change the variable to email address so email and after that click on ok and change the variable name here to so txt search and click on ok after that we are going to change the like buttons name as well as we are also going to change the fields this fields name so change variable so txt pro duct name let's copy this and it's okay change variable name and here we are going to write price price okay and change variable name this one too and here we have to write a total and after that we have to click on ok and this one is just to clear so btn clear okay and here we have to change this to btn add to cart and after that we have to click on ok and we have to move little bit down and here we have to change this variable name because we are going to set the value so ldl label uh grand total okay and we also need to change this variable so btn generate bill print this one name we are renaming it as okay and just save this after doing this we have to move to the source so just click on this and here you can see the variables so we are going to declare some variables so public and so bill id and initially let's say we are setting at one after that public end grant total is equals to zero and after that public end product price is equals to zero public and product total is equal to zero so this uh like variables is self-defined you can see its grand total totals whatever the amount product price whatever the product price and this is product total it means that if item is one if the price is 100 item is one it means the product retail should be 100 okay and if it's so 200 it will increase according to that after that actually we need her pattern so public string and email pad turn so you can directly copy it from login page or somewhere else so i'm just going to copy this directly and paste it here and let me place it semi column public string and we also need mobile number pattern so mobile number pattern equals and in double scores we are going to copy that pattern so let's copy this and here let's paste it and after this we have to move to the like uh next part here in the place order and here we are going to disable or enable or whatever the read-only fields let's create that do that so txt product name so this one this one so this should be read only right we are not allowing user to delete it so product name product name dot set editable and here we are making it as false txt product price this one dot set editable and we are also making it as false and after that txt pro total dot set editable and here we are also making it as false after that the button i like uh button add to cart this button should be disabled by default so so enable and we are making it as false so whenever it does not contain any value so in that case this button should be disabled so whenever the form load it should not contain any value right so that's the reason we are disabling this button okay and after that uh we have to like also disable the button generate button actually so generate build button dot set enable and let's make it as false and after the j uh j format text formatted text field this one this option you can see it automatically imported this and we have to write this and tf is equals to and here we have to also make it at editable false the spinner that's right that's the region i'm writing this j s spinner this option one okay this one is one i think let me check the name actually so let's go right here and yeah jspinner1 and uh dot and actually jspinner dot uh okay we don't need here jspinner we have to write j spinner we have to import actually jsp now this one from swing you can see we imported this and from here we have to get uh sorry jspinner dot default editor this one and here g spinner here we have to import that jspinner1 dot get editor this one dot get text dot get okay it should be outside of this dot get text field this one and tf.set enable enable and we are making it as false and after that we are going to set the value so user email this user email should have the email we are going to pass whatever we will get from home page i'm just writing here after writing this we are going to create some methods over here so let's create that here and here first material is public white product name by category and here we are going to get the category name and in this we are going to write default table model after that writing this press ctrl and space bar two times so it will uh give options to import so you can also write this to import it and after that you have to write dtm the variable and here in the packet default we are going to write it again default model and after that j table one dot get model this one and dtm dot set actually we are removing all the raw from that table table one this table actually i'm talking about whenever that method call this two line means is we are removing all the record from this table and that's it set raw count it should be zero after this we are going to get the some value from array okay it should import add a list and you can see we imported the add a list and it will import from util package and add a list and it should be a product type actually so product and list equals to so product dao so we have to import so you can see it's imported input down dot product down and from that we are going to call the method get all the records by category and the category will be pass it from here and after that we are going to get those values we are going to use the iterator sorry not travel it should be iterator so so it later we are going to use this we are also importing this from java util package and here we are going to write product okay we are getting the product actually so so we have you can see we are getting the options to import it from model so you can see we already created this model and get back over here and here we have to write idr equals to list dot iterator this option semi column and while i t r dot has next then we have to run and here we have to write product product this one and product of obj object equals to idr dot next and dtm dot add draw add draw this one and here we're going to write new object object and here we are going to write product obj dot get name this one and save this you can see the second actually method has been created and after creating this method we are going to do exactly same thing so just copy this lines of the code and paste it over here and we are going to make changes in this line so filter product by name so after that string name and the category we have so dtm table get model and here we just need to change to filter and in this we just need to pass two variables so name category so here we are passing this and we are getting the names and we are going to set it over here that's it what we are doing till now after this uh creating two uh like methods the next thing is we are going to like uh sit uh let me move a little bit down okay this is completing over here and this one yeah yeah okay we have to move outside of this method so just write it outside and here we're going to like write the code to clear product field so public clear product fields and here here we have to write txt proname dot set text and in this we are not going to write anything so txt pro price dot uh set text and here we are going to write nothing and in j spinner we are going to set the value is to be dot set value and here we are going to write one and t x t pro total this one should also not contain anything so just write this and button should button of add to cart should be enabled should be false actually okay after that we are going to validate the fields so just uh we are going to write the code for that so now uh let me move it up okay so public void validate field this one and here and here we have to like check if else condition so first we have to get the value so customer name first to txt customer name dot get text and after that string customer [Laughter] mobile number is equal to txt customer mobile number dot get text and after that we are going to get the value string customer email is equals to txt customer email dot get text and after that if this condition here we are going to write if the customer not equals to this so equals and in the doubles this one and and customer mobile number dot matches matches you have to pass that pattern so it should be mobile number pattern actually while number pattern and and customer uh email address dot okay uh one more thing we have here forget here customer mobile number length should be equals to 10 so length is equal equals to 10 and and customer email dot match and here we have to pass the user email okay and after that we also need to check one more thing so the grand total should not less than zero the value so like grand or equals to zero so grand total this i'm going to call and let's make it as this condition if this condition is satisfied you can see the complete condition a customer matches mobile number customer length is sorry customer while number link should be 10 customer email address dot match user sorry sorry here we have to write email pattern actually so yeah i was doing mistake so after that grand total should be greater than 0 after that like we have to we have to mix line what we need to write is is button generate this button bell which generate the bill so the set enable in this condition satisfy we are making it as enable and else condition we are making it as disable actually so btn generate build.set enable and here we are making it as false after writing this have to move to the okay one more thing we forget here so we forget to generate an event so whenever page opens so in that case though that even get trigger so we can just open the navigator if navigator is obviously not there you can directly go to the windows and you will definitely you will see the navigator this option and after that you have to just move to this jframe form and just right click event component show event this option you have to select it will generate an event so here you can see that event so in this event few things we are going to do is so bill id is equals to integer dot parse end and here we are going to call the build out build out so i think it import automatically you can see dow dot build down yeah after that uh like calling we are going to get a get id method we are going to call that and after calling that we are going to set our the bill id actually so just check it out the variable name so the variable name is three so j label i is three so we have to set the value in this dot set text this one and here we have to pass the bill id okay so bill build out actually we are going to call it again dot get id so this bill id we are going to use to like open the like uh form and like whenever pdf has been generated that's why we store in this okay we will check it later okay leave it for now and let's move it uh so error list let's create a list and in this we are going to write the category category grid type actually so the category type model we imported it and after that list equals to category type category dow actually we have to call so category tau so it will automatically import it you have to import it manually if you want or just place ctrl spacebar twice it will import it so get all records we have to call this method and here we have to call the iterator this one and here we are going to call the category again i'll sorry write category type so ipr so list data iterator and okay it should be iterator not iterable so here i again make mistake so iterator this option and after iterator we have to write y i t r dot has next and here we have to write category category category object obj and itr dot next and in j combo box we are going to set all the values so add item this one and in the category object from the category object we are going to get the name this one and after that we are going to write a string category category is equals to string type j combobox1 dot get selected actually we have to select the item and after that product product and product name by category we have to pass that so that uh it will load the data okay in that table so after writing this we have to we have to move to the design section and here just uh like we have to generate the so just event key and we have to write like key released whenever the key is released then we have to call this event so here we have to like get the name first string name and txt we are going to get the value txt dot search dot get text whatever the value in that field so after that we are going to get the category so category and the category should be like a string and j combo box one dot get selected item this one and after that we have to call the filter filter product and in this we just need to pass the name and category that's it so it will search the particular product and it will display in this table this table okay after that what we need to do is we have to just whenever like any on any field whenever any user click so we have to add the values in this four fields right these four fields so just do that so just right click on this and we have to generate a mouse click event so just mouse clicked event this event and in this we are going to write the n index we are going to get the value of index and goes to j table j table one from j table one dot get selected and we are going to write selected draw and here we are going to go for table model and we are going to get it from java x swing dot table it will import automatically let me show you what we imported right now you can see table model that we imported after that uh here we have to write model is equals to j table one dot get model this one and after that string product name is equals to model and here we have to write model dot get values at and here we have to write libat index and we have to write here though like 0 dot 2 string this format we need and after that we are going to get the value so product product equals and we are going to call the product dao product dao this one and dot git product by name and here we are going to pass the product name actually so okay it should be small actually and here we are going to product name this variable and after that uh like we have to get that value we will get when we get the value we need to set that right so txt pro name so txt pro name dot set text set text and here we have to write product dot get name i think product dot okay it should be not like that product dot get name this one and txt pro and after that we have to give the price takes t in dot price dot set text set text so product dot get uh like price and after that g spinner in that we have to set value 1 so dot set value and here we have to write 1 and initially the txt pro total value so pro total value is sorry dot set text and whatever the value we are getting whatever the price you can see product dot get price and that will be the total for initial okay after that product price price and we have a global like we have created a variable so we are going to product set the values in that so product price is equals to integer we are converting this is a form of string so we are converting that dot parse end and in this we are going to like write product dot git price and after that we also going to store in product dot total equals to integer dot parse int and here we are going to write again product product dot get price and let me move a little bit down and after that btn add to cart dot set enable and here we have to write true so in like when we set the values in this fields after that we have to enable this fields right so that's the reason we write that good that last line after this like we have to like uh whenever the chain state changes right of the g spinner in that case like uh we have to call a event so just right click on this and even okay just just double click on this let's see what event it should rate okay let me double click okay let me event event change state change we have to select this one so after that we have to move it over here and here we have to get the quantity so whatever the quantity t so it should be integer type we will get from actually type casting we are doing here spinner dot git value this one and after that if quantity quantity is less than equals to one in that case uh we have to j spinner g spinner this one dot uh we have to set the value and the value should be one and the quantity is equals to one and after that like uh if and like you can say the next product total is equals to product price is equals to sorry here we have to multiply so and quantity whatever the quantity and the txt pro total here we have to set that value so set text uh sorry so yeah say text and here we have to write string we have to convert it to string so string dot value values off and here we have to write product product total this one and just save it so let's test it out whatever what we did tell now so let's move to the login page and let's run this run file so that you are able to see what we did till now so let me enter the credentials statement and this let me click on login and here we are let me place order so here you can see we are able to load the data so i think we don't have any values in this the t or whatever let me close this and let me check it out the new preview products and okay we have one product in shoot so type so let's move back over here and let me select the shape i think there is some issue we will fix it out not to worry so let's close this and let's exit this application uh let's move to the place order and till now we did not generate it even for this one so just double click on this and you can see event has been generated for this and here we have to like pass a string category category equals to and it should be like cast string and here we have to write j combo box one dot get selected selected items and we are going to pass this value to the method so product name by categories and we are going to pass this and save this i think some process is running let's stop this and just run this tightly from here so you are able to see it but it will give error at like you can see you are able to see this right so it means that it's working fine now let's move to the next you can see we are getting the error because email was not there that's why it's giving us data so we don't know we don't need to worry because we will start it from login it will work fine so let's close this after doing this we have to next thing is uh we have to like whenever we click on this button so it should actually uh like add that product in the below table this table right so we are going to write the code for that actually so here the first thing is the string uh name equals to txt product name so product name dot get text this one string price is equals to txt pro price dot get fixed after that the next is the string quantity a string dot value off and here we have to write g spinner g spinner one dot get value this one and after that uh the next we have to call the default default table model let me move a little bit up this two yeah after that dtm is equal to uh like default default model and j table to dot get model this one and here we are going to add that value to particular raw and here we are going to write new object object this one remove this bit and start the bracket and here we're going to write name price up quantity and after that product total and after that we have to grant total total is equals to grand total plus product total we have to add it and display it so product total and after that we also need to send the value of the grand total label so dot set text and here we have to write like we have to change to string so string dot values off and here we have to write grand total and after that we also need to clear some fields so clear product we have to call this and validate field like everything is uh validated the grand total values will change to 0 to some value so it will um maybe enable your field that's the region we are calling the validate field and after doing this uh we also need to do like we have to write the code for this so just double click on this and we have to call the clear method in this field after that like whenever the like customer you can see this we are going to call an event so key our released event so just generate three event for this all event key released design event key released and after this we have to write here validate field and we have to just copy this line of the code and here we have to paste it and in this field we also need to paste it and save this after doing this uh the next step we have to move to generate the bill actually the main part of this page actually so let's move back to here and we have to just click on this generate build and we have to move it over here so let's minimize this and first thing is we are going to add a jar in this project that is i text okay which we are going to use to create our pdf okay so you can just google it you will easily get the itex jar so you can see i text dot jar you have to add it and make sure the in with dot jar okay some is going to add or dot zip and they ask for error that's why i'm saying it and let's start with that so let's write here string because uh okay customer name is equals to txt customer name this one dot get text this one and after that the string customer mobile number is equals to txt uh like customer while number dot get text this one and string customer uh email is equals to txt uh like customer email dot get text after that we are going to get the email sorry date so in a simple date format format we are going to import it let me show you simple java text simple date format we are going to import it ah let me move over here so from here d format is equals to here we have to write new simple date format and here we have to set that format so in double quotes we are going to write db x mm and after that we are going to get the date so date is equals to new date and string okay it's uh giving us some error we can import it from java util so we imported it from google package and after that today uh like date we are going to write date as equals to the format the format dot format and here we are going to write date after that and with semicolon after that string total is equals to string dot value of grand total this one and string created pi is equals to user email whatever the user email address we are going to pass in created by after that we are going to create the object of bill so it should be bill model this one and we have to import it and after that bill goes to new bill and after that bill dot uh set id this one and here bill id we have to pass that and after that bill dot set name and here we have to pass the customer name actually customer sorry name it should contain name and bill dot set our mobile number so mobile number so we are passing that customer mobile number this one and build.set email and here we have to pass the customer email let me move a little bit down here customer email and bill dot set uh like date so the date should be today's date and after that bill dot set total so we are going to pass that total actually and bill dot set created so we will pass the created by and after that bill okay after this we have to like we added all the values for all the particular fields which are in bill class so after that we have to call the build out in that we have a created dot c method and in that we are going to pass that bill so it having a query which will save the data so that's why we are passing the object of this okay after that we are going to write the code to create create document so create creating document now here first we are going to write the path where we want to store so path is equals to intervals we're going i'm going to write a store this is at e drive so just going to write e and after that put the semi column and now com dot i text this one pdf dot text this one and in this we have to call the document this document talk is equals to new com dot i text dot uh text dot document this one and after that we have to write try catch block so try catch if any exception occur so exception this one is important here and here we have to just pass the e and in the try block what we need to do is we have to like write first pdf pdf writer pdf writer we are going to import it from let's see from where we are going to import it so com.itex pdf text pdf.pdf writer we are going to import it from here let me move back over here and here we have to write dot get instance this one we are going to select actually and here we have to write doc and in this os instead of that we have to write new file file output stream you can see and here we have to just write path first path space plus double quotes and after that we have to write bill bill id plus and double quotes dot dot pdf dot pdf and at last we have to put the semi column and let me move a little bit let me minimize this too and after that uh now we have to open the dock dot dot open and after that uh let's write here paragraph super graph paragraph we are importing from com i text pdf dot text this one so paragraph is cafe first thing we are going to insert is the caffeine name so paragraph this one and here in the double quotes we are going to write the caffeine name so i'm just going to copy this line of the code and paste it over here so it will look as look to the center let me delete one slash nine yeah okay you have to write the semi column and after writing this let me move the next line and here we have to write doc dot add so it will add that particular thing in the document after that we have to create a new paragraph so paragraph and star line actually it's a new paragraph to lip attractive we are using this and in this double quotes we are going to put some stars so you can choose it according to yours i'm just adding let me put semi column at this line and let me move back here so after writing this so doc dot add and here we're going to write the star line we added it and after that we have to like create again the paragraph and the paragraph name just going to write three and here we are going to write new paragraph and here we have to just pass like whatever the details of the user we have to enter so bill actually here we have right t so bill and after that bill id and here we have to write plus double quotes slash n and here we have to write customer name and plus plus and here we have to write the customer name and here we also need to put some space so that consider it and after that customer name then next we are going to display the total date and here we are going to write grand total and save this now now we also need to save this uh like add this in dog so dog add and here we have to write paragraph three after that doc dot add star line we are going to add it and after that we have to insert pdf table actually so pdf table it's not showing any option not a problem pdf table okay we have to import it from actually it's a pdf p table that's why it's causing issue so pdf p table this one we have to import and after that uh we have to write db one equals to new p df this one and here we have to just pass the like numbers of uh columns so i'm just going to write here four let me move a little bit down here and here doc dot add and here we have to write like uh sorry uh actually we have to write here db1 dot add cell and here we have to write name name tv1 dot add cell and in this next one we are going to write price after price tv one dot add cell and here we have to write quantity after quantity the next we are going to write tb1 dot add cell here we have to write total after total the next we are going to do is we are going to like run the loop so that will insert whatever the values in that pdf okay so end i is equals to 0 is less than j table 2 actually dot get raw count dot i plus plus after that here we have to write a string string and this is equals to j table g table 2 dot get values at here we have to write the i and we have to write zero dot to string and let's copy this values okay so let's copy this and one two three let's change this to any name for now you can make it change it by use okay after that we are going to add this values in the table cell so add cell and here we're going to write n let's copy this and let's paste it one two three and here we are going to write d r and q sorry it's q after that we have to write actually so db sorry doc dot add and here we are going to pass the db1 sorry tb1 and here we have to also adding add star star lines after that we are going to write a message thank you message you can see paragraph thanks message equals to new paragraph this one and here we have to just write thanks thank you please visit again and after that we have to put semicolon doc dot add and here we have to write thanks message semi column at end and here the main thing we have to write is to open the video so till now we did not implemented write the code for that open pdf i'm just writing here open pdf and we will do it at the end of this video so after that like in outside of the catch block we are going to close this actually so talk dot close and we are going to refresh this page actually so let's uh set the visible and make it as false and new place order here we have to just pass the created by id created uh sorry yeah it's small created by whatever the variable we have created here so we just need to pass it so we have the variable name so it should be created by yeah we have to just pass this name place order dot uh set visible and we are making it as true and save this after doing this we one more thing we forget here we have to like when we click on this wrong it should show a message that do you want to remove that column or raw sorry so for that we are going to write the code so just right click on this event mouse clicked even we are going to for it and here we are going to write index in in sorry index after the j table 2 dot get selected row actually after that end is equals to g option fan we will ask for confirmation dot show message confirm dialog okay it should be show confirm dialog this option and the first should be null after that do you want to remove this product and after that we are going to write select and after select a j option pan this one dot yes no option yes no option at the end we are going to put the semi column and if a is equal equals to 0 it means that it's selected yes in that case we need to perform the operation and here we are going to get the value from the table model model model is equals to j table 2 and dot git model this one and string total is equals to model dot dot get values at we have to write the index and we have to write the this dot to the string we also need to like uh like we also need to subtract the from the grand total whatever the total value that's the reason we are getting it so grand grand total is equals to grand total subtract an integer integer dot parse end and here we are passing it total and after that label we are also decreasing the values from that set text and here we are going to like write a string dot values of and grand total after that we have to remove that particular field so here default default model we are going to call j table model 2 dot get model here after that dot remove remove raw and here we have to just pass the index that's it so after that save this and now now at last we are at last of our videos so now we are going to create a package that will like we are going to create a class uh which we are going to open the pdf so lets create a package here so just right click on source package and create a new java package and let's rename it as common and click on finish so after that we have to right click on this and we have to click on java class and we have to write open pdf and after that we have to click on finish okay after that like we have to move in between this and here you have to write public static while we don't need to return anything so open by id and here it will return sorry it will get a id type value so after that here we have to write try catch block and here we have to write exception in this if any exception occur the same we have to display so g option pan this one dot show so message dialog null and here we have to write try in the try we have to write if actually new file and we have to save the path actually so flash okay it should be in double quotes so just add this and file plus id whatever the id we will got dot which day after that uh dot ptf and after that here we have to write exists this one okay first we need to import few things yeah import java dot input output dot uh file and after that exist and we have to start and in the bracket you can see it has been removed uh after that we have to write here process p equals to run time run time we have to select this one and dot get runtime dot exe and here we're going to pass rdn dll32 space url dot dll comma file proto call handler and after that we have to just write e this one and whatever the id we have so just plus actually a semi column first and after that id and after that we have to write dot p d f and after this of offline of the code okay if anything error occur let's say the file is not there so it will give us that message so here we just need to read this and here we we're going to write file is not exist and save this so we are going to call this method over there so let's move back to our place order page and let's move back over here and just read this line of the code line sorry commented code and here we are going to call the open open pdf just place control you can see it's able to import it from that you can see what we imported you can see common dot open pdf let's get back over here dot open by id and in this we are going to pass string dot values of del and id this one let's save this uh i believe all the parts related to place order is completed let's test it out if we face any issue we will fix it let me run this admin at the gmail.com and here we have to write admin let's click on login and we are able to move to the place order so let's see it's working or we're getting an issue let's move to the soup and let's click on this and let's okay it's i think it's we changed to disable it should be read only we will check it later but it's working fine okay so it should be 4 5 whatever let's uh add to cart you can see this right here got off here i'm going to write some more number one two three four five six seven eight nine zero and got up at three gmail.com you can see it's automatically get enabled so let's uh click in on this generate build bilge details added successfully click on ok so after that it will refresh this page and you can see the mouse you can see it's loading something so it's depend upon your system like how much time it will take to open that particular pdf so here you can see we are able to see all the details like name but it having not a space so we forget to right here slash and that's why it's in same line okay not a problem we will fix it so you can see it's uh everything is working fine let me exit this application let me fix that first so let me move to the place order and let's move back over here and here we just need to write slash and and let's move little bit up to here so here we have to change set enable to editable actually so it will fix our issue so let's test it out and just run this run file and admin gmail.com admin let me login this uh let me move to the place order you can see it's visible right so let's off this change the soup and let's click on this you can see add to cart it's working fine so let me exit this application so this is all about please order part of cafe management system project i hope you guys like this video so please hit like and subscribe my channel thank you hello everyone welcome to my youtube channel in the previous video we just created this place order part of cafe management system project if you are not seen that video just go to the description and check out the link in this video we are going to create a new jframe for this view build and order place details so let us start with that and we are also going to fix one issue of place order so let us start with that first and so let me show you the issue actually so here you can see in the pdf we are seeing the same values in the price quantity and total all this and it's totally wrong right so we have to fix this so first we have to move to the place order page and you can see we have generate bill and print pdf right just double click on this and move here and here we just need to change this to one two and three and save this and after that let's test it out it's uh like pdf is uh issue is fixed or not so let me run this let me into the credentials admin let me click on login and here let's open the place order page and let me enter the details let me enter gmail.com let's click on this let's increase this add to cart and let's generate this bill and let's click on ok you can see and you can see the bill here so it's changed according to like a video a quick overview video so we fixed that this issue okay so let's minimize this let me exit this application let me create a new jframe for this okay let me exit this and right click on this project and let's create a new jframe form and here we have to write view bills order okay it should be order placed details and after that we have to click on finish so it will create a new jframe for us and first we are going to remove min max close button from this page so right click on this go to the properties okay it's uh yeah so just click on this one and close this and let's increase the sizes to 1366 comma 768 and click ok and save this after that first level we are going to insert over here and this label we are going to rename it as view bills and order placed details and after that we also need to insert the icon so icons okay we have to move it here in this package images and here we have to select this one after that we have to click on ok close this and we also need to insert the button to close this form so just insert this and here we have to select the icon to images and here we have to select this one close icon and okay just close this and we also need to remove this text let's decrease this side to 35 36 and let's place it over here and the next uh we have to insert here labels let me place it one first label and let's rename it as a filter by date let me move a little bit up this one and let's say please uh place a field over here and the text here it should be a text field and let's place it over here let me increase size to let's say let's make it as 270 edittext remove this and we are going to insert one more label here and here we are going to write change order by id and after that we are going to insert a combo box here and let's increase size of this one to make it as 270 and after that we are going to remove these items let's write this all and remove this so after that we have to write i n c d e s c d increment and decrement and after that we have to insert here tables so let's move a little bit down and let's select this table and let's place it over here let me move it okay let me move a little bit up and here let me increase the size of this table let's make it as a max of this form almost let's go a little bit down and here we are going to insert one text field sorry one label and the label name should be uh sorry not label name on the like whatever the value so click on draw to open bill we are going to write this and let's go to the properties increase the size of this one so i'm making it as bold 36 and let's move to the this one okay just close this after that we have to just place it over here center of this page i think this one is our center of the page and after that uh we have to select this all and we have to increase the size of this field sorry uh whatever the value in it will store so make it as bold 14 okay just close this after that we have to change the like table content right it should be like table content here we have to click column we are going to rename it one by one so id first one is for the id and the next one is for name after that the next uh for mobile number number and after that it should be email and we also need to uh increase the size like this one four five six okay after email the next one is for date and after date uh so total amount total and at last we have to write actually created by created by or generated by it's your choice and after that we have to remove the like uh raw so just decrease this to zero and just close this and save this form and you can see almost our gui is completed we have to just insert a background image over here so just move to this section image and here we have to select like full page background this one dot png okay close this and okay one more thing here we forget so before adding any image we have to change to absolute layout after that we are going to insert the image so let's select it again and here we have to go to images and here we have to select full page background image okay close this let's place it over here and let's double click on this form label and remove the label name and save this so now we have to change the color right so just select this and right click on this and go to the properties and we have to make it as white and close this okay one more thing we forget here we also need to change the color of this one so make it as white too okay save this you can see our gui is almost almost completed yeah it's completed actually so now after this we need some methods so we are going to tao so just tau click on down this one and after that we have to move to the build down so this one and let's move here and here we are going to write the method which we are going to use to get the values so public static and it should be any list and bill get all records by increment and here we are going to pass the date so string date and in between we have to like let me write here so it now let me create a array list first array okay it's giving us error import it from java util add a list and here we have to like right arrow list this one and it should be build type and add a list equals new addi list this one and after that we have to write try catch block catch block and here we have to write uh display the whatever the error we got right so show message dialog null and here we just need to write e [Music] and in between catch here we just need to write exception e and uh after that here we have to retry block we have to create the object of bill first so bill bill is equals to new bill and in bill this will we are going to get the one by one value of all the fields it have so bill dot set ids this one and here we are going to write rs dot get in this option okay sorry so i think these lines should be in while okay so first we have to write the query right so rs equals to operation db operation db operation dot git data this one and here we have to first pass the query select a star from bill where date like and in between we have to pass that date whatever we get right so after that here we have to like write plus plus date and at last we have to put semi column and here we have to write y r is dot next and in this we have to actually write the okay so here let me check out the query select star from bill where date like and date yeah it's correct so let's write here kit and here we have to get the value and here we have to write the whatever the column name so id i'm just writing one by one we are going to set the value so build.set and here we have to set the name so rs.get a string this time and in this between we have to create a variable name bill dot set while number and here we have to just write the artist dot git while okay sorry rs.get string and here we have to just write mobile number after mobile number the next one is for email address so bill dot set uh email and here rs.get string this one and in between we have to write email and here we have to write bill dot set date this one and in this between we have to write rs.get string and in this bit being we have to write date and bill dot build dot set total and rs.git string and here we have to write total and after that bill dot set created by and here we have to write rs.get string and in this between we have to write created by after that here we have to like add this object in arraylist so add a add and in this between we have to just pass the bill okay now you can see it's still giving us error reason is we till now we did not return anything of error list bill right so we have to return it actually so here we have to just write return and return this one and here we're just going to write this and save this you can see this one is ready one method is ready okay so let me copy this same method and let's paste it out here again just copy this and let's paste it here so you can see we are getting error so we will first change the name of this one to this one descending and after that here we have to just change in the query and here we have to write order by id descending you have to just pass that and after that the other things will be same there is no change in other things we just need to change in query that's it so whatever we will get the date we are going to pass it over here and order why we are just here adding it and it should be descending right now let's uh get back over here and the first thing is we are going to do is we are going to write the code for this and lets right here set visible visible false false and we are going to connect this page with home page so let's move to the home page and double click on this and here we are going to write new build view fill and this one and dot set visible to true and save this let's get back over here and now now the first thing is we are going to like state the date in today's date in this field right so let's move to the source and here we are going to do that thing so here we have to import the simple date format to set the format actually so this one and here we have to write the format variable new simple simple date and here we are going to display the we are going to write the same format update which we are using while inserting okay and y y four times and after that here we have to get the date so date equals to okay we are getting error it's not a problem just click on this or you can directly import it from java util okay so just click on this you can see it automatically imported this package right after that new date and here after that we are going to create a variable so string type let's say d format equal d oh sorry it's equals to d format dot format and here we just passing the date and okay so here we also need to write the today date and the next line we have to write j text field in text field 1 we are going to set the value so set text and here we have to just pass the today's date and save this when we run this it will like pass the today's date after that we have to create a method which we are going to call it to change the data of our fields sorry table and here we will write table table details and here we have to write the first string date equals to j text field uh we are going to get the date jtx1 data get text text and after that we are going to value that increment or decrement and it should be a string type because we are getting we have to convert it and it should be from j combobox dot gets selected item this option and after that we have to get it okay after that we have to remove the values from the table so for that we have to call the default table default table model this option and you can see this imported this one import java swing table default this option and after that here we have to write dtm equals to default table model and after that we have to write the table name dot get model this one and after that we have to remove all the rows from that so dtm dot set raw count actually to zero okay after that we have to check if else condition if the value is ascending or descending so i n d this one variable dot equals and it should be matching we are going to match with inc it's inc it means that we need we don't need any changes whatever like it should be increment by id and add a list any list actually this one and it should be like build type so bill list equals to and here we are going to call the build out this one uh after that build out and we are going to call the first one the second one actually and in this we are just passing the date and for build out we have to import this one and for the bill you can see it will give us option import from model dot bill just click on it it will import this one model our model okay sorry get this one model and after that list when we get the list we have to map it on our table so for that we are going to use the iterator called the iterator this one not uh yeah iterator this one from util you can see java util after calling it trader we are going to try should be bill i t r equals to list dot iterator this one and while while i t r dot hash next if having value then it will be continue and bill bill obj obj equals to i t r dot next and here we have to set the value so dtm dot add raw and here we have to create the new object this one delete this and here we have to just uh pass the all the values so bill bill object sorry bill obj dot get id the first one bill obj dot get name bill obj dot get mobile number bill obj dot get email address and after email address bill dot obj dot get or date actually so date bill obj dot uh get total amount and bill obj dot get created by created by this one so let me show you so you complete line so dtm uh add raw new object bill gate id will get name oil number email date total and created by all this okay after that uh we just need to move to the else condition if the if condition is this then we have to move the else condition so else and here we have to copy the same line of the code here we have to just copy this and paste it over [Laughter] here okay and just format this code so it will automatically make it as uh look good okay after that here we have to change this get all to descending and save this you can see if else condition if its values i and c increment then it will move to this one and if it decrement it will move to this one okay and we are going to call those methods whenever like things get changed okay so let's uh click on this okay first we have to call the text field right so sorry from this one so key released whenever the value changed right so in that case so here we are going to call the table content sorry table details and for this one just double click on this it will generate a actually action so in that we are going to call the table details and at last whenever we click on the mouse it should uh sorry when we when we click on the table by using mouse then it should open the pdf right so just uh generate that even mouse click given this one and here we just need to write end index equals to j table 1 dot get selected selected draw this one after that table model we have to import model it's java x swing table this one option and model equals j table one dot kit model and after that we have to write string id is equals to model dot get values and let me move a little bit up okay it should be first it should be index and here we have to write 0 dot to string and after that we have to call the open pdf actually open pdf this one we are importing it from common package common package which we created yesterday sorry last video and here we have to just right here open pdf and we have to just call a method from that open by id and here we just need to pass the id so let's save it so you can see our all the code related to this page is completed so let's run this and test it out that it's working on we are getting some issues so let's move the login page actually and let's run this okay so here we have to enter the credentials gmail.com here we have to write admin let's click on login and it will open a page and here we are view bills and order details to load the data i think we are not calling it so let's close this application and let's move back over here and we have to open this page and move to the design section and open this navigator and if navigator option is not there just click on this window navigator here you can see after that you have to click on this jframe and right click on this generate event component component show this one and in this we are just going to call the table table details field okay and save this after that we are going to let's check it out once again that that issue is fixed or not and let's yeah let me enter the credentials again gmail.com admin let's login it let's click on this and here you can see you are able to see the data right and after that let's click let's decrease this you can see it's changed right uh let's uh delete this one then you are able to see with one two three four five let's try to open the id of like four so it will trigger our pdf you can see let's open the pdf4 let's open the another one this one you can see it's open 3 right so it means that everything is working fine for the view bill or and order place details part of cafe management system project i hope you guys like this video so please hit like and subscribe my channel hello everyone welcome to my youtube channel in the previous video we just created view bills and order please details part of cafe management system project if you are not seen that video just go to the description and check out the link in this video we are going to create a new jframe for this change password so let us start with that let me exit this application and let me create a new jframe for that so right click on this click on jframe form and here we just need to write change password after that we have to just click on finish it will create a form and here we have to write 700 comma 400 and we just click on ok and after that we are going to insert a label over here and let's change it to change password and in this we have to like insert the icon so just click on images and after that we have to select for the change password icon and okay just close this and after that we have to insert a button so right click on this and we are going to select the close button sorry close icon so this one close okay close this let me read this text remove the text from this field let me make it as 30 and let's place it over here and after that we are going to insert labels one by one so it should be old password and after that the next label is for new password password and the next label is for confirm password so confirm password and for this we have to insert the password fields right so let me insert one by one so it should be 230 sorry 250 and the password field next field 250 password field 250 and after that we are going to change the variable name so so txt old password let's copy this and click on ok and change variable name and paste it here and it should be new and the last one we have to change this to confirm after that okay and just remove the text from this remove this text read text remove this it is text remove this after we are going to place the buttons over here one by one two buttons we need here so one is for update or change the password or update you can say and one is for clear the fields so let me right click on this and let's uh go to the images and here we have two images and here we have to select the save dot png image okay close this after that we have to select the clear png image so clear dot png okay and after that we have to change this one to clear and okay after this we have to select all these fields and we have to make it as bold 14 so just go to the properties and here we have to make it as bold 14 okay close this you can see our gui is almost completed we have to just insert a background image so let's place it icon sorry label and we have to first change to absolute layout after that we are going to properties of this label and here we are going to select a background image so image and here we have a small page background dot png just select that click on ok close this let's place it perfectly on this jframe form and list click on it and you remove this label name and let's select this all the labels name and right click on this and just change the color of this ones to white and click on ok just close this and save this after that the first thing is what we need to do is we have to get the like value from home page to this one like email address right so for that we have to do some changes so first we are going to create a variable here so public string user email and here we have to just uh copy this three lines again and in this just format this it will automatically adjust in the correct format so a string email and whatever they we will get the email address so we are just going to set it to this email and after that we have to move to the home page actually so in the home page just double click on this change password it will generate an event and here we have to just write change password this one the next one we have to select with email dot set visible we are going to make it as true and save this so it will pass the data to this page okay one more thing we forget here we have to also change the variable name of this one actually so the variable name of this one should be dx sorry btn button update okay save this now let's move to the source of this page and the first thing is we have to like uh uh writing before writing any code we have to move to the user dial and here we are going to create a method which will actually get some parameter on the basis of the if we perform some operations in our database update and select okay so static void change password and here we are going to get the values string email and string hold password and after that we are going to write string new password and after that we have to just let me minimize this and let's write here like try catch block and here we have to write exception and here we have to just write j option pan this one dot show message dialog and here we have to just write null and whatever the error we will just pass it and the try block we have to write a query select query first so select result set rs equals to db operations dot get data and here we have to just pass the query so it should be select star from user where email is equal to single doubles and plus plus and here we have to just pass the email and and here we have to write password is equals to singles tables plus plus and here we have to write password and if this condition is like we get some value right so if rs.next if it exists in that case we have to perform the update operation is we have to ch like display message that the password is incorrect dot show message dialog null and here we are going to write the whatever the message we want old password is wrong they're going to display this message and in if condition we have to just call them method and in that we are going to okay we are getting error so it should be not a password only it should be old password this one actually okay after that uh here in if condition we are like in user dao we already have a update this one you can see this one so we have to just pass the email address to this two to update it so it will show the message password change successfully so let's do that so let's call that method actually here so we are going to call the update method we already have we are going to pass the email address and whatever the new password is you can see so let's save this and let's get back over change password dot jump and here first thing is we have to disable the uh this button update button right so just uh like right here ptn dot set enable okay so it should be like uh bt and i think yeah btn dot update dot set enable and here we have to just write false save this and after that we have to write for the validation so let's write here public white and validate fields and in this we are going to write get all the values sorry yeah hold password and txt old password dot get text this one and after that we are going to go for new password txt new password dot get text this one and after that the string confirm password equals to txt confirm password dot get text and here if old password dot equals is nothing you can say then we have to make disable and here after that new password new password dot equals and here like uh and not confirm password and it should be like confirm firm password dot equals and here we have to just write this and we have to check one more thing so new password and dot equals actually equals and here we have to just write confirm password it should be matched right then only we will enable that button so let's uh let me show you the complete line here and after that here we have to write btn update and here we have to write set enable and here we have to write true and else we have to write btn update dot set enable and we are going to write false and whenever this fields will be like uh change right the value so we have to call that so just generate the event for this event key released event key released and for the last one event key released this one and here we are going to call that validation actually so validation field and validation field this one and at last we have validation field and save this after uh like doing this uh we have to like clear this field okay before clear we have to need to close this so double click on this and here we have to write set visible make it as false and after that we also need to kill you right so double click on this clear and here we have to write set visible and here we have to write false and in new and here we have to just uh like whenever it's refresh right clear so we have to pass whatever the user right so here we're going to pass a user email address dot set visible and here we have to just write true and after that we need to like save this things right so just click on update and here we have to write string string old password equals to txt old password dot get text this one and string new password okay we have to just copy you all those three lines actually so so just copy this and paste it over here and here we have to just write we have to call the user dao user dao this one actually user down now this one dot and here we have to call the change password this one and here you can see automatically taken the user email address old password new password actually here we don't need this uh confirm password so leave it uh this one we are just passing the new password and after that we have to just rephrase this page so set visible false and new change password dot we have to just pass the user email address dot set visible and here we're going to write true save this now now we also need to remove bin max close button so let's open this like project and here we have to just open the navigator and we just need to click over here it will show here after that click on jframe form go to the properties and remove this just click on this and after that we also need to set the location where this form will be open so just select this and in the x axis you have to write here 350 and for the y axis you have to just write 134 click on ok and just close this and save this out okay so let's move to the login page and let's try to check that our password is able to change or not so let's open this this okay so admin at the gmail.com and here i'm just going to write admin just paste it over here and let's move to the change password here you can see now i'm just going to write admin 1 and the password i'm going to write 1 2 3 and one two three you can see it's get enables we when we delete one you can see automatically disable so let's just test it out update old password is wrong okay so it means that we are writing wrong password so one two three one two three let me click on update it's correct everything is correct we have admin the correct password right now and one two three and one three is matching so let's click on update password change successfully it means that it's working fine so let me close this let me exit this application let me open the database and let me show you actually so select from user here you can see we have a admin user you can see the possibility changed to one two three previously it was admin so it means that change password is working as expected so i this is all about change password i hope you guys like this video so please hit like and subscribe my channel thank you hello everyone welcome to my youtube channel in the previous video we just created this change password part of cafe management system project if you are not seen that video just go to description and check out the link in this video we are going to create a new jframe for this change security question and this one is also our last video on cafe so let's start with that let me exit this application and let me create here a new j frame form so right click on this and right click on this jframe form and here we have to write change security question and after that we have to just click on finish it will create a page for us you can see page has been created now first we are going to increase the size of this to 700 comma 400 and press ok and after that we are going to remove min max close button from this form so i am just going to click over here and we are also going to set the location of this page so we have to move to the location let's move a little bit up here you can see the location and here we have to end x axis we have to write 350 and for the y axis we have to write 134 and we have to click on ok close this and save this form and after that we are going to insert a label first here and let me rename this to change security question and after that we also need to insert icon in this images and here we have to go for change security question this one and we have to click on ok and close this and after that we have to insert a button so let's place it and go to the properties and insert the icon so images and here we have to close icon and okay close this edit this text remove this text from this one and this decreases to 30 and let's place it over here and after this we have to insert few more labels here and the first level this one is for the old security question and for this we need a text field so let's place one text field over here let's increase the size to let's make it as 251 and next level new security question question and we also need text field for this one too and let's place it over here and let's increase the size to same the next field this one is for new answer and we're also going to use text field for this and and at last we need password from user so password and it should be password field so we have to select this one and let's place it over here let's increase the size of of this one and let's place two buttons over here so one button for update and one button for clear and after that we have to select this all and we have to increase the sizes to make it as bold 14 so let's make it as bold 14 okay close this and after that we also need to change this one we have to insert the icon first so let's insert the image and here we have to select the save save dot png okay close and here we also need to change the text to update and this one name should be clear and the clear icon you also need to insert so images and here we have to select the clear.png image okay close this and we also need to remove this text from all the fields so we will do one by one and we also need to change the variables name so one by one we are also going to do that so this one is for the txt old security question this one let's copy this and here change our variable name here we have to write new new security question and here we have to write txt new tensor answer and at last we are going to write txt password okay and save this after that we have to insert a background image so just place a label and change the layout to absolute layout after that go to the properties of label and we have to insert the icons so images and here we have to go to the small pagebackground.pngmaze and we have to close this place it perfectly on this frame and double click on this it will remove this and save this okay we are getting some kind of error either you can see automatically get removed and so let's change the color of this all fields and let's right click on this and go to the color of this one and let's make it as white okay and close this and save this and after doing this we have to move to the like we also need to write some dao matters we have to create so let's move to the user dao and move last of this speech and here we are going to create two more functions so here first function is public static void change security question and in this first we are going to get the email address and the next we are going to get the password and after that we are going to get the string security question whatever the new security let's minimize this let me make it a little bit up security question and after that at last we have a string and so and here we are going to write try catch block exception and here we have to display the error if any occur so g option pan dot show message dialog and here we have to write null and we have to just display e and in try block here we have to write result set set rs is equals to db operation we have to call db operations dot git data and and this we just need to pass the query so here let's write select start from user where email is equals to singles doubles plus plus and email and password is equals to singles double and here press plus and here we have to pass that password [Music] and after that we have to check the if else conditions so if r is dot next it means that it have in some values else if it does not have any value it means that we have to display the exception that password is wrong so dot show message dialog null and here we have to write e and save this okay sorry not e actually we have to display the message so password password is wrong and in if condition we have to call a method so we have to create that method actually so here just uh right here public static void update we already have a update method but uh the parameter we are here we are going to use like more parameter and let's write a string email string security question question string string answer and in this uh we are going to write query string is equals to and here we have to write update user set security questions set security t question equals to singles tables plus plus security question this one and and and and answer we also need to update so and so is equals to singles doubles plus plus let me put a column so it error will get removed and here we have to write and so you can see it has been removed after that we have to add where clause where email is equals to singles and doubles plus plus and email and after that we have to just pass this query in db operation methods dot set data this one we have to pass that query and we also need to pass the message we need to display so security question changed successfully this message we want to display so for in if condition we are going to call that method and we are going to pass that values so let's update this one and we are going to not use this method we are going to use this method and press enter here you can see automatically write the whatever things we have to pass so first is email address next is security questions and the last one is answer okay so these two methods we have to create in the user dao after that we have to move to change security question piece here and let's move back over in the source okay one more thing we forget here so we also need to generate a component show event so we will generate it uh now actually so let's click over here you can see the jframe in navigator option you can see you can also see the navigator option from here and in the jframe form just right click event component show event we have to generate to load data whenever page load okay so after that minimizes let's create a variable first here so public a string user email and after that uh i think we are getting some kind of heater here okay it's automatically get removed okay i think taking loading it's that's the reason it was showing some error okay so uh we have to copy this line of the code and we have to paste it over here let's format this actually yeah now here we have to get the email address so here i'm going to write email and that email we are going to pass it to that above variable so user email is equals to email and after that we are going to disable some uh fields so txt old securityquestion.set editable we are going to make it as false and after that we are going to also disable the button so btn okay we did not change the button i think variable name change this so btn update let's click on ok let's make back over here so btn okay it should be not set action actually said editable this one and after that button update this option dot set enable and here we have to write false so it will disable our button after doing this we have to call the validity we have to create a validation here method that data is entered correctly or not so field and let's open this and after that string password equals to pxt and here we have to get the password dot get text this one string security question is equals to txt new security dot get text and after that the next we are going to get answer txt enter okay i think uh there is we have to check the variable uh this one change variables so yeah it's correct so let's copy this and let's check it and copy this directly here dot get text and after that we have to check if else condition so password password dot get uh sorry dot equals actually we have to check but it's not equal to this and in the same way we have to write for security question dot equals doubles and and and enso dot equals and we have to doubles and after that we are going to write here disable that button so btn update dot set enable and here we are going to write true and in else condition we are going to disable that button button update dot set enable false and we are going to this call this method whenever like this fields whenever key is released for three fields key released let's generate the event for all so even key released event key released this these events and we are going to call it this one is component show so for now we have to not write anything so validate fields we have to call this method let's copy this and let's paste it over here and here we also need to paste it here and save this after that we have to write the code for this one button so let's double click on this and just right here set visible and going to write here false and the next thing is we have to like write the code to let me move to this one update button right so whenever anyone hit the update button so we have to like call that method right so string password is equals to txt okay all these things should be same actually so we can directly copy it uh from here and let's get back over here in the button event and just format this and after that we are going to write user dao user dao this one we have to import we have a user down in the dow package and here we have to call the change security question this one and you can see it automatically take everything username should be it's a web declared a variable level and the password security questions answer you can see after this we have to like uh if the successful call or anything we have to hide this j frame and we have to display the steam j frame right so change security question and we have to pass the email address and dot set visible and here we have to write true and after this we have to also write the code for the killer right this page so let's copy this to line of the code so let's double click on this and we are going to paste it the same line over here and let's format this again and after this we have to write one more line of the one or two line of the code in the component show event which we generated it earlier so here you can see the form component show event and in this event we are going to write user we are going to import the user type actually user type model we already created this in this model section you can see model package you can see user.java and after that we have tried user is equals to and we are going to import user dao down this one dot get security question we already have this method i think we are using using this in email uh sorry forget password and here we have to just pass the email address sorry yeah email address and txt old security questions and we have to set the text and here we have to write user dot get security questions and save this so we also need to connect this page with our home page so just move to the home page and design section so just double click on this and you can see here we are going to write new change security question change security question this one dot set visible and here we have to write true let's save this let's test it out it's a working fine or we're getting any error let's run this from login page run file so here we have to write admin at the gmail.com and the password is one two three let me log in this and just click on change security question you can see the word what's primary school did you attend so this one is we cannot edit it but we can edit this one so we are going to change the security what is what was your bit name question mark i'm going to write it copy this and here i'm going to write tom and the password we have one two three four sorry one two three so but right now we are going to write four and we are going to try to update this so update password is wrong okay let's paste the question again and here we are going to write tom and right now we are going to write one two three and let's click on update you can see security question change successfully and let's check out the clear button too you can see it's working fine so this chain security question is also working as expected so this is all about cafe management system project i hope you guys like this video so please hit like and subscribe my channel thank you
Info
Channel: BTech Days
Views: 5,136
Rating: undefined out of 5
Keywords: cafe management system, cafe management, cafe management system in java, cafe management software, cafe management system project in java, cafe management system java, cafe management system project, cafe management system java source code, complete project, with source code, java, jframe, swing, java project, jframe project, swing project, final year project, computer science, signup in jframe, database connectivity in jframe, computer scienece, cse project
Id: cBu88Z1BNXY
Channel Id: undefined
Length: 465min 13sec (27913 seconds)
Published: Sun Sep 12 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.