Java Projects for Beginners | Java Open Source Projects | Java Certification Training | Edureka
- December 19, 2023
- Posted by: MainInstructor
- Category: BASIC Go Java Web Development
Video Title: Java Projects for Beginners | Java Open Source Projects | Java Certification Training | Edureka
Hey everyone this is Neha from add Eureka I welcome you all to this session on Java projects in this session we will be discussing three useful projects which are based on code and advanced Java concepts the projects that I will be discussing today are ATM machine which is based on core java concepts
Text editor that is based on swings and applets and the signup form which will make use of servlets and JSP concepts without wasting any further time let’s get started first ATM machine all of you know what is ATM and how it works but implementing the same using course our
Concepts as something interesting so let’s see how to do that here we will be developing the code for user account details bank account and then further we will perform few operations like deposit the amount withdraw check the balance etcetera basically it’s based on kochava concepts and stef locked using eclipse
So all that you require is your Chava install that is your JDK and JRE and you just need to have Eclipse installed on your machine let me tell you one important thing that as I have said the privileges for account number and password that is you
Can see on the screen that I have given two account numbers and passwords while running the code if you give the account number and password as mentioned on the screen only then you can do the further operations else it will just display a message saying wrong account number
Orphan now let’s see how it works and how the code is being developed so basically when you run the code this is how your console appears and it asked me to enter the account number that will be the one which I mentioned on the screen and password is going to be this thing
Enter so when you enter this it will ask you to select the account you want to access status whether your checking account your saving account etcetera so first I will say type one that is checking account so in the checking account the operations that you can do
As you can waive the balance you can withdraw funds you can deposit the funds so let’s see how much balance is there in my account it’s zero is it now I want to deposit the funds and the checking account so how will I do that again checking account option 3 which is
Deposit funds so it’s asking me amount you want to deposit from checking account so I say I want to deposit some ten thousand enter so you can see here the new checking account balance is ten thousand correct again I will choose checking account and now I want to
Withdraw the imam from the checking account so I’ll say option two I’ll say I want some five thousand from that account so you can see here I’ve withdrawn five thousand and the new checking account balance will be five thousand so this implies I haven’t drawn five thousand from the account again I
Will choose option one I will view the balance so it says five thousand is remaining correct now we’ll go to savings account and again view the balance and do the same operations balance is zero again same thing I want to withdraw some funds like say four
Thousand it says four thousand and now I want to be draw some funds say some five thousand let’s see what it says when the amount that we want to withdraw is more than the amount and the bank account it says balance cannot be negative correct so when you try to
Access more amount and which is there in the bank account like the savings account it says balance cannot be negative similarly you cannot just enter the negative values into this now say I want to just withdraw some two thousand and it says the new saving account balance will be two thousand so
Basically this is how you can do operations like same way you do it on your ATM machines and now I want to just say I want to exist suppose if I enter invalid account numbers say I’ll enter something like this and I’ll give the pin something it
Says wrong customer number or pin number that as I have said the privileges only for those two are confident shifts so that I can access using only those two numbers you can even include more account numbers and pins I’ll show you how to do that so basically this is all about the
Working of ATM machine let’s take a look at the core now so here in a Eureka one package I have created three Java files one is for account one is ATM and one is optionmenu so now let’s see why we have three files for ATM and how it works
First we’ll see option menu so you can see here option menu extents account class that does this Java class I’m just reading a money format that will be in decimal and then I’m creating a hash map of integer and then I’m creating a variable of type hash map and leaving a
Reference for that so basically the first thing that I want to do is I want to validate the login information that is customer number and the number as I have already told you that I have said the privileges for two numbers that does these two account numbers and pins if
You want more you can just copy this data output paste it or you can change like whatever you want you can add more number of privileges like this so the first step when you execute it will just say welcome to ATM project and enter your customer number correct so first
What you will do you will enter either of these customer numbers and then it will ask for pin number I’m reading the customer number and pin number using menu input dot next int so in case if you enter some characters it has to catch an exception correct so what it
Will do it will say invalid characters and it will ask you to enter only numbers because I have set the privileges only phone numbers so in this for loop I am trying to check whether the entered customer number and pin number is correct or not if it is not
Correct it will print saying wrong customer number or pin number that you already saw on the output so after that if the enter credentials are correct then this method will execute that is the get account type in this get account type I have mentioned these choices that
The select the account you want to access checking account saving account choice etc and then using the switch case I am using get checking get saving methods if you press exit it will say thank you for using the ATM bye and in the for choice if you press a choice that is
Not correct it will say in ballad choice so here is the gate checking and I have defined the method over here that does get checking so what all we had and the gate checking method view balance withdraw funds deposit funds I said correct now I am reading everything that
Is account balance using money format withdraw input deposit input and everything will be in get account type method correct and obviously case four will be your exit so it will just print saying thank you for using the ATM pipe now similarly for savings account that is view balance
With draw funds deposit funds etc again we are using switch case to print the saving account balance saving withdraw input saving deposit input everything so this is all about your option menu class now we will see what is there an account class so here it is just required to set
The customer number and set the pin number that is first set the customer number and written customer number and then you set the pin number and return the pin number so basically account class is to retrieve all the details that has been set in option menu that is your checking balance saving balance
Your withdraw and put deposit funds everything that has been mentioned and option menu class so you can see here that I have checking balance method and I am returning the same and again I have saving balance so here you can calculate the checking account withdrawal that is checking balance equals to checking
Balance minus account and then it will return the sim that as we saw that when we want to withdraw 2000 from 4000 it will say the new saving balance will be 2000 similarly the same thing will be here that is saving by ones- amount like that so similarly you can calculate the
Account deposit the saving account deposit that is the balance plus amount that you enter suppose say the saving balance is 0 and if you enter 2000 so it will add and it will return the balance similarly the same thing with this as well that is account withdraw and put
Pan customer saving account withdraw input as well and then it will just check the deposit amount same thing for savings as well and I have initialized all these variables as private because I want them to be local to the class so this is how it works and now coming to the last file
That this ATM dot Java so here this class extents option menu and option menu extends occur so what ATM should do it should obviously extend option menu and I’m just creating an object of option menu and just trying to get the log in from option menu so when I execute again
It works same it lasts same thing again if I enter something it says your own custom opinion account number as I have told if I enter something else apart from the numerix it says invalid characters only numbers that is the exception that I have thrown so this is
All about the ATM project I hope you understood it now let’s move further and see the text editor so here I am making use of Java swings that as I will be using J text area menu bar J menu bar etc and all the menu items will have
Action listener to detect any action and as I have told it makes use of Java applet and spring concepts and similarly all that you just need is a Java installed on the Eclipse IDE we can say like we can perform all the operations like we perform in your WordPad or your
Notepad and it’s very efficient so now let’s see how it works so first let’s execute and see how it works and then I will explain you the code so you got a text editor here you can see you have file and it consists of all the operations like new open safe exit
And you have edit option like cut copy and paste you have font like bold plain italic and half size like up to 28 and you have font I practice Roman Helvetica Arial collier century etc and also you can set the background and foreground color and you can undo and redo the operations now
Let’s see each of them how it works so I want to say like welcome to ed Eureka YouTube channel and enjoy learning now suppose I want to change the font of this I’ll capture everything like controlling and then I’ll give font like bold so you can see
Here it became bored say suppose I wanted to be italic you can see even that became italic as well I want to increase the font size like 28 it got done I want to change the font type to century when that happened say I want Helvetica I want Times Roman even that
Happened say I want a color to give for that like background color and something like say I want red okay you can see the background color is red so I want to remove the background color now now I will change the font color to be
So I want to enter some more text like I did as Java projects and I want to undo that I can just press ctrl-z it goes on removing all that thing and ctrl v for whatever I have deleted you can see it’s going on also you can create a new file
That I just read also if you want to open something that was already present you can open from the libraries also if I want to save this I can save it like however I want in the Downloads or in desktop whatever you want you can save
The file by giving save it it will be saved I can under something and again if I want to save it it will be saved like applet one similarly we can even check that whether it is being saved or not so in desktop you can see it as being
Saved as Apple an applet one so basically this is all about your text editor as how it works like you can perform all the operations like edit form file color undo redo everything etc sounds interesting let’s see what is the code behind this now so here you can see a undoable text area
That extends a text area an implement state editable white implement state editable is because we have defined the editable class in which we can edit all the options like I showed you on the text editor so you can see here I have given the key state as undoable text
Area key and then I have declared the current edit and undo manager and the first undoable text area I have defined it in various ways the first thing is zero parameterised and then the next I have defined some parameters like string and I have given it in super as well and
Then I have used rows and columns and then I have used string along with rows and columns and then string rows columns and scroll bars as well so in various ways I have declared this undoable text area constructor so if in case something happens you are stuck and you cannot
Undo some operations that you have performed then automatically the exception will be catch here and next same for redo as well if you cannot perform any video operations then it again catches an exception you might be wondering why it need to catch an exception correct it’s just because to
Maintain the normal flow of execution so that your further operations will not be interrupted and next we will store the state and restore the state that I have given I’m using the key Siddhas variable and for the snapshot method I am giving like condition if the text is being
Changed then use undo and added it to edit the current state and now I am declaring the init undoable and giving some new reference variables for undo manager and current edit and I’m adding the key listener for new adapter and then I’m using the focus listener to
Focus the even that was being captured and similarly for text listener as well if the value is changed it has to say that the text is being changed and now you can see there’s a text editor class which undoable text area has extended and this I am declaring few parameters
Like frame file dialogue font etc and now here comes the text editor parameters like say courier add style at size everything and here I have used the option menu bar that this times Roman Helvetica Arial century etc I have given one one parameters for each of them and then
Using the add method I’m adding all of them like appending it to the menu and we have to use the action listener to detect any action that is being performed so similarly for bold plain italic menu that all we saw and again using action listener we are calling
That even and then I’m declaring all the sizes over here that you saw little 28 and appending it using the add method and to detect them I am using add action listener even for new open save exit again using action listener for all them and for cut copy paste edit options as
Well for background and foreground color and for color for undo redo for everything it all remains the same and then I’m implementing the action listener class to invoke that method correct like for undo and redo and similarly for filename untitled for select menu everything so whatever the
Options we have seen here they all have to implement the action listener class so you can see I am detecting save else what happens the action will not be detected you can see again for exit as well for read file everything and even cut copy paste for everything we have to
Use action listener classes even the size class implements action listener like for a size 10 size 12 for 14 16 18 similarly till 28 that’s all and then I’m extending an applet class and implementing the action listener even for this in bold I want courier font
Everything and even in plain I wants the same thing so as you can see if I type anything here so it is by default color correct so that’s what is here that is in get action command and bold plain and italic whatever it is the first singers
Career correct and then comes the type that the Stynes Roman Helvetica quarry or Arial black century everything and then again I am choosing the color that is the background or foreground colors and then I am implementing the main method and setting the size of the text
To 800 and 600 so that’s how it works like you can perform any operations on accelerator and do leste everything now let’s move further and see the sign of form which is developed using surf les GSP and web development tools like HTML CSS etcetera so I’m just going to create
A basic sign up form and all that you need is servlets Java server pages apache tomcat server and cascading style sheets and Eclipse for Enterprise Edition it’s very easy to develop as I’ll be showing you how so first let’s run the output and check and then I will explain you the backend code
Make sure that you run on server my Tomcat server is starting now so this is the sign of foam that we have created you can enter their name I’ll give some email like 13 or older is my option so here in the signup form you can see your name email
Password your age I’ll give some biography like I’m a footballer singer swimmer exited like this my hobbies I can give my education everything you can give like it’s not mandatory that it should be the same thing and the job role have so many options and web mobile business and others so I’m very
Interested and iOS developer so I’ll give that and interests RN development design business everything and when I sign up it says hi Chris welcome to Erica because the sign of that I have done got saved so there will be the output like or where you can see the
Details that you have entered in the backend in this console tab you can see the details that you have entered that is your name your email ID your password your over-30 in your biography your job role your interest etc so that’s all was there in the form
So you can see here in this form these are the basic information that has been given so now let’s take a look at the backend code in the sign up I have created five files like HTML for creating a form CSS file to add some beauty or makeup to the form that we
Have created we have servlet class files like request post form and person one dot Java class and then to retrieve the data from the servlets we have the JSP file and also we have the Weber Dex ml file to add the mappings to the servlet and we have JSP
File to retrieve the data from the servlets so for this front-end that is your signup form we have used HTML you can see here that I have linked with CSS as well that is for giving some make up to the file that as you can say beauty
To the form that you have created I’m giving form action as request post form and Method will be post so here you can see in the label you have created like name email password age you’re under 13 or about 13 whatever it is and then for your profile or your biography
You have created one more label tag and giving the text ID is equal to bio and name is equal to user bio and for the job roles are so many so you have created a first label for job role and the first opt group label will be web
And web you have so many options and again you are closing that and opening one more up group label that will be your mobile your business your secure your other so same things and then for your interest like this one you can see you have check boxes over here correct
For that check boxes we have given the class type value everything like for development for design for business everything and last it will be the submit button that will be your sign up so this is how your index dot HTML file will be and now coming to main door CSS
File for each everything I have given the padding’s like a phone family the color the maximum bed the margin background everything even for the first thing that will be the h1 I have aligned it to center you can see here I have aligned it to Center and
That is an h1 even for that I have given the specified color and the phone family as well and coming down for forum as well and for all these things I am using a select type for background border font size height margin out like padding but color everything even for the box shadow
As well you can see there’s a shadow for this box it’s not just a simple one and even for the check boxes for buttons that is present as well for feel set for legend tax for label for number tax everything so this will be your main dot
CSS now let’s take a look at the servlet classes so first what I am doing here is I am extending our HTTP servlet class correct and I’m using our do post method and declaring parameters for request and response I am requesting all the parameters that is your username email
Password age biography job and for your user interest again the same thing and then I’m creating an object of person and trying to retrieve all the details and then I am trying to request and set the attribute of my person and then using the dispatcher I am trying to
Request the get request dispatcher from JSP and obviously in the dispatcher tour forward you will be having a response and request both of them so as I have created the object let’s see what was there in the person in this it’s nothing but it will retrieve all the details
That is I have made everything as private because I want it to be a private to the person class and this class is called as a beam class I will tell you by I have made a constructor of person 1 and then using the parameterised constructor I am trying to
Reference and retrieve all the details you can see like forget name method I’m returning the name and set name I’m retrieving again forget email and set email methods forget password for get paid set H for bio job roles interest everything this is nothing but our defining a constructor and retrieving the details and
Request post form is essential to send a request and response and then person bundle Java is essential to retrieve the details and then as I have told it is requesting a dispatcher to log in one so in the login window JSP class I have imported the beam class that has a
Bureaucrat a person one by because I do Rica is my package and person one is my class and then I am giving the scope as request and similarly as I have imported the beam class and similarly to redirect it to the next page I have used a small
Icon and you can say that it says welcome to Eureka so this is all about the GSP and then now coming to the last file that was web dot XML you have to add mappings to the file you can give servlet name like anything but make sure
You give the servlet class name very properly that is it should be like Ed Eureka that is your package and your request post form which is your class name this should be very correct and then for URL pattern that this request post form URL this should be same as the
One which you give in form action tab that is your request post form URL or else it will result in an error so this is all about the signup form I hope you understood how it works so that’s all for this session if you want to have a
Source code or the files of this explanation and all you can just comment your email ideas in the comment section below don’t worry we won’t expose your email ids for security purpose we will contact you and send all the source code and files to the given email ids that’s
All for the session thank you and have a nice day I hope you have enjoyed listening to this video please be kind enough to like it and you can comment any of your doubts and queries and we will reply them at the earliest do look out for more videos in our playlist and
Subscribe to Eddie Rica channel to learn more happy learning
Video Keywords: *, yt:cc=on,java projects,java projects in eclipse,java open source code projects,java projects step by step,java projects step by step in eclipse,java projects with source code,ATM Machine java project,text editor in eclipse,Sign-up form using Servlets and JSP,login form java,Basic java projects for beginners,Text editor using applets,text editor using swings,edureka,java edureka,java certification training,java for beginners,java training
-
Sale!
Wireless WIFI Repeater Extender Amplifier Booster 300Mbps
$29.99$14.99 Add to cartWireless WIFI Repeater Extender Amplifier Booster 300Mbps
Categories: Electronics, Wi-Fi Router, Wireless Wi-Fi Extender Tags: 300Mbps, 802.11N, Amplifier, Booster, Extender, mobile wi-fi booster, Remote, WIFI, Wireless, Wireless WIFI, Wireless WIFI Repeater, Wireless WIFI Repeater Extender, Wireless WIFI Repeater Extender Amplifier, Wireless WIFI Repeater Extender Amplifier Booster, Wireless WIFI Repeater Extender Amplifier Booster 300Mbps$29.99$14.99 -
Sale!
Full RGB Light Design Gaming Headset Headphones with Mic
$24.99$14.99 Add to cartFull RGB Light Design Gaming Headset Headphones with Mic
Categories: Electronics, Gaming, Gaming Headsets Tags: Design, Full, Full RGB Light Design Gaming Headset, Full RGB Light Design Gaming Headset Headphones, Full RGB Light Design Gaming Headset Headphones with Mic, Gamer, Gaming, Gaming Headset Headphones, gaming headset wireless, Headphone, Headphones, Headset, Light, Mic, Package, RGB$24.99$14.99 -
Sale!
Wireless BlueTooth Multi-Device Keyboard Mouse Combo
$39.99$19.99 Add to cartWireless BlueTooth Multi-Device Keyboard Mouse Combo
Categories: Electronics, Gaming, Gaming Keyboards, Keyboard Mouse Combos Tags: Combo, Keyboard, keyboard mouse combos, Mouse, MultiDevice, Set, WireKeyboard Mouse Combo, Wireless, Wireless BlueTooth Keyboard Mouse Combo, Wireless BlueTooth Keyboard Mouse Combos, Wireless BlueTooth Multi-Device Keyboard Mouse Combo, Wireless BlueTooth Multi-Device Keyboard Mouse Combos$39.99$19.99 -
Sale!
High Back Leather Executive Adjustable Swivel Gaming Chair with Headrest and Lumbar
$199.99$139.99 Add to cartHigh Back Leather Executive Adjustable Swivel Gaming Chair with Headrest and Lumbar
Categories: Gaming, Gaming Chairs Tags: Adjustable, Chair, computer chairs, Desk, Executive, Gaming, Girl, Headrest, High, High Back Leather Executive Adjustable Swivel Gaming Chair, High Back Leather Executive Adjustable Swivel Gaming Chair with Headrest, High Back Leather Executive Adjustable Swivel Gaming Chair with Headrest and Lumbar, High Back Leather Executive Adjustable Swivel Gaming Chairs, Leather, Lumbar, Office, Racing, Swivel$199.99$139.99 -
Sale!
Professional LED Light Wired Gaming Headphones with Noise Cancelling Microphone
$29.99$19.99 Select optionsProfessional LED Light Wired Gaming Headphones with Noise Cancelling Microphone
SKU: N/A Categories: Electronics, Gaming, Gaming Headsets Tags: Cancelling, Gaming, Gaming Headphones with Noise Cancelling Microphone, gaming headset, Headphones, Headset, LED, Light, Mic, Microphone, Noise, Professional, Professional LED Light Wired Gaming Headphones, Professional LED Light Wired Gaming Headphones with Noise Cancelling Microphone, Wired, Wired Gaming Headphones, Wired Gaming Headphones with Noise Cancelling Microphone$29.99$19.99 -
Sale!
Gaming Desk with LED Lights USB Power Outlets and Charging Ports
$349.99$249.99 Select optionsGaming Desk with LED Lights USB Power Outlets and Charging Ports
SKU: N/A Categories: Computer Desk, Gaming, Gaming Desk Tags: and Charging Ports, Charging, Desk, Desks, Gaming, gaming desk with led lights, Gaming Desks with LED Lights, Home, LED, Lights, Monitor, Office, Outlets, Port, Power, Room, Stand, USB, USB Power Outlets, White, Workstation$349.99$249.99 -
Sale!
Wired Mixed Backlit Anti-Ghosting Gaming Keyboard
$99.99$79.99 Add to cartWired Mixed Backlit Anti-Ghosting Gaming Keyboard
Categories: Electronics, Gaming, Gaming Keyboards Tags: Antighosting, Backlit, Blue, brown, Gaming, Gaming Keyboard, gaming keyboards, gaming keyboards and mouse, Keyboard, Laptop, Switch, Wired, Wired Mixed Backlit Anti-Ghosting Gaming Keyboard, Wired Mixed Backlit Anti-Ghosting Gaming Keyboards, Wired Mixed Backlit Gaming Keyboard$99.99$79.99 -
Sale!
Wireless Bluetooth 5.3 ANC Noise Cancellation Hi-Res Over the Ear Headphones Headset
$119.99$59.99 Add to cartWireless Bluetooth 5.3 ANC Noise Cancellation Hi-Res Over the Ear Headphones Headset
Categories: Electronics, Gaming, Gaming Headsets Tags: 5.3 ANC Noise Cancellation Hi-Res Over the Ear Headphones Headset, ANC, Audio, Bluetooth, Cancellation, Ear, Earphone, gaming headset, Headphones, Headset, Hi-Res Over the Ear Headphones Headset, HiRes, Noise, Wireless, Wireless Bluetooth 5.3 ANC Noise Cancellation Hi-Res Headphones, Wireless Bluetooth 5.3 ANC Noise Cancellation Hi-Res Over the Ear Headphones Headset, Wireless Bluetooth 5.3 ANC Noise Cancellation Hi-Res Over the Ear Headphones Headsets$119.99$59.99 -
Sale!
Wired Sports Gaming Headset Earbuds with Microphone
$19.99$9.99 Select optionsWired Sports Gaming Headset Earbuds with Microphone
SKU: N/A Categories: Gaming, Gaming Headsets Tags: Accessories, Earbud, Earphone, Earphones, Gaming, gaming headset with microphone, Headphones, Headset, IOS, Microphone, Sports, Wired, Wired Sports Gaming Headset Earbuds, Wired Sports Gaming Headset Earbuds with Microphone, Wired Sports Headset Earbuds$19.99$9.99 -
Sale!
150W Universal Multi USB Fast Charger 16 Port MAX Charging Station
$49.99$29.99 Add to cart150W Universal Multi USB Fast Charger 16 Port MAX Charging Station
Categories: Charging Stations, Electronics Tags: 150W, 150W Charging Station, 150W Universal Multi USB Charging Station, 150W Universal Multi USB Fast Charger 16 Port MAX Charging Station, 150W Universal Multi USB Fast Charger 16 Port MAX Charging Stations, 150W Universal Multi USB MAX Charging Station, 16 Port MAX Charging Station, 3.5A, Charger, Charging, Fast, laptop charging stations, Max, Multi, Port, Stand, Station, Universal, USB$49.99$29.99
Got a question on the topic? Please share it in the comment section below and our experts will answer it for you. For Java Training Curriculum, Visit our Website: http://bit.ly/32Ymvde
This was very useful, and informative, thank you so much, can l have the source code
Thank you edureka!
Can i get source code! Please…….
This video is soo good can you share the source code plz.
Hello please send me source code
plz share the source code
Good explanation, easy to understand can u share the source code plz
Very well explained. Kindly share source code. thanks.
I LIKE the project can u please share me the source code
What an amazing session!! I will be really grateful if you can share the source code.And Excellent explanation
I will be really greatful if you share the source code.. That was a great sessions.
wow nice explanation…can u please share ur source codes?
@edureka Can you please share the source code for ATM machine?
Very helpful example
Ur explaination is superb mam can u pls share the sourcecode of signup project pls?
plz share source code
What an amazing session!! I will be really grateful if you can share the source code.
Hey the tutorial was great can you share the source code or share your email ID, I will reach out to you there
Sir, very nice Project with outstanding explaination..
Sir can I get source code of the ATM PROJECT.!
Excellent explanation about the project. Please share the source code.
Can u please send me an ATM project source code
It is very helpful for beginner like me by just learning core java and some Java concepts I can perform a project but can I get a source code because some of lines are not visible in the vedio , thankyou.
Great project.thank you
Please can you share the source code?
The tutorial was amazing. It can be really helpful for this videos. Please can you share the source code.
mam can you share mi source code
Please Share The Source code for atm..I have already shared my Mail Id
Please can you share the source code.
The tutorial was amazing . It can be really helpful for this videos. Please can you share the source code.
Mam/Sir pls Can you share the source code for ATM project..it is very helpful
Getting stuck with entry query in Optionmenu . Java ., Kindly share the source code with me
Please share the code
Amazing session! Will be grateful if you can share the source code .
such a amazing session . please could you share the source code of atm machine .
Hey can i have the source code pls .