Java login system 👨‍💻

preview_player
Показать описание
Java login system

#java #login #system
Рекомендации по теме
Комментарии
Автор


public class Main {

public static void main(String[] args) {

IDandPasswords idandPasswords = new IDandPasswords();

LoginPage loginPage = new

}
}

public class IDandPasswords {

HashMap<String, String> logininfo = new HashMap<String, String>();

IDandPasswords(){

logininfo.put("Bro", "pizza");
logininfo.put("Brometheus", "PASSWORD");
logininfo.put("BroCode", "abc123");
}

public HashMap getLoginInfo(){
return logininfo;
}
}

import java.awt.*;
import java.awt.event.*;
import java.util.*;
import javax.swing.*;

public class LoginPage implements ActionListener{

JFrame frame = new JFrame();
JButton loginButton = new JButton("Login");
JButton resetButton = new JButton("Reset");
JTextField userIDField = new JTextField();
JPasswordField userPasswordField = new JPasswordField();
JLabel userIDLabel = new JLabel("userID:");
JLabel userPasswordLabel = new JLabel("password:");
JLabel messageLabel = new JLabel();
HashMap<String, String> logininfo = new HashMap<String, String>();

LoginPage(HashMap<String, String> loginInfoOriginal){

logininfo = loginInfoOriginal;

userIDLabel.setBounds(50, 100, 75, 25);
userPasswordLabel.setBounds(50, 150, 75, 25);

messageLabel.setBounds(125, 250, 250, 35);
messageLabel.setFont(new Font(null, Font.ITALIC, 25));

userIDField.setBounds(125, 100, 200, 25);
userPasswordField.setBounds(125, 150, 200, 25);

loginButton.setBounds(125, 200, 100, 25);



resetButton.setBounds(225, 200, 100, 25);



frame.add(userIDLabel);

frame.add(messageLabel);
frame.add(userIDField);

frame.add(loginButton);
frame.add(resetButton);

frame.setSize(420, 420);
frame.setLayout(null);
frame.setVisible(true);

}

@Override
public void actionPerformed(ActionEvent e) {

{
userIDField.setText("");

}

{

String userID = userIDField.getText();
String password =

{
{

successful");

welcomePage = new WelcomePage(userID);
}
else {

password");
}

}
else {

not found");
}
}
}
}

import java.awt.*;
import javax.swing.*;

public class WelcomePage {

JFrame frame = new JFrame();
JLabel welcomeLabel = new JLabel("Hello!");

WelcomePage(String userID){

welcomeLabel.setBounds(0, 0, 200, 35);
welcomeLabel.setFont(new Font(null, Font.PLAIN, 25));
welcomeLabel.setText("Hello "+userID);

frame.add(welcomeLabel);

frame.setSize(420, 420);
frame.setLayout(null);
frame.setVisible(true);
}
}

BroCodez
Автор

It's a great video well and clearly explained. As a Java beginner, it has saved me time and the headache I could have gone through in class. Thank a lot. I wish if you could do a video of the same but with a connection to MySQL database where the IDs and passwords would be store in the database.

petermwajinje
Автор

you are more useful than any of my university professors

michaeledie
Автор

Another great vid, very clear, well explained. Would be great to learn how you develop this code from scratch.
Thanks again, keep up the great work!

ResTwitch
Автор

Muito bom que conteúdo Exemplar, que bacana e leve o jeito de fazer e explicar embora não entenda nada do que diz . Tá de parabéns Obrigado por compartilhar o seu conhecimento 👏

damiaofernandes
Автор

your videos are getting better and better, this one helped me understand a lot better some previous concepts. thanks!

angelcastineira
Автор

I watched this video a thousand times this weekend and it helped me do and understand my homework assignment. thank you so much for such a good step by step video with explanations that are clear and easier to understand.

amandatimmons
Автор

Thanks for such a wonderful video lecture😍.

primeoptumas
Автор

First, I'm so glad that I found your channel. I started messing with Java because I understand it better than my wife and she's leaning on me to help her with her college class. She's sitting at a B, because she suffers test anxiety and doesn't really put in the work. Her final project is using 2D arrays and it bugs me because her class is so slow. I learned so much more by watching your videos and I've only been learning for less than a month.
Second, I created a rudimentary RPG text based console game (complete with main menu, shop menu, inventory for shop and player, player classes, enemies, and enemy classes, combat engine, and combat menu). What I learned from you helped tremendously. I mostly did it on my own, but there were a few times that I had to google something. While googling, I ran into 2 scenarios that irked me. Which leads me to number 3 (last one).
Third, I ran into lazy people basically expecting others to do their work for them (almost like my wife) and elitist MF's. The lazy people only bothered me a little. In the end, they're only hurting themselves. Elitists, though. Those people piss me off. Nobody is born with all the knowledge and all the skills. No one is born at the top of their field. Everyone starts at the bottom/beginning at some point. Elitist either forget that, or they like to pretend that they skipped that part and became a god at whatever it is that they're doing. This mentality hurts other people and can even turn them away.
Plus they seem that everyone can read the docs (or man pages) and automatically understand it. However, everybody learns differently. Me, I learn by doing. I can read stuff all day long, or listen to someone all day long, and I'll never understand it. I have to do it for it to stick in my mind. Sorry for being long winded. Thanks, again, for doing these awesome videos.

andromydous
Автор

O cara é magnifico, um vídeo bem explicativo e muito bem feito.
Thanks <3

antoniolima
Автор

My recent favorite YouTuber... Love from🇧🇩

adibkhan
Автор

very clear and helpful.
Thank you for that video

justinbanza
Автор

It is very interesting to learn to catch concept of develop design; I expect another better video from you, thank you so much.

elsaeelias
Автор

Please do as many projects as possible sir..Loved Your Concept..❤️ from india

hariom
Автор

Nice video, well done, thank you for sharing it :)

Bianchi
Автор

Hey Bro Code, thank You so much for dedicating the time to put this video together. It truly helped me to understand this new concept of Java for me.

mrCetus
Автор

Thank you Bro Code, it all went very well and I could understand most of the code lines that you ecplained logically. Thank you very much!

amedeekreuzer
Автор

Great tutorial. Keep on with the good work.

radosmirkovic
Автор

As Java beginner, I've finished this after days of trying to understand 😁

azro
Автор

Wow I got some idea from your work Thank you

y.bgamesplayer