Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package raizel;
- import javax.swing.*;
- import java.awt.*;
- public class LogIn
- {
- private JButton login,signup,register,back,delete,update,logout,delbutton,upbutton;
- private final JFrame frame;
- private JTextField typelog,typesign,typesign1,typesign2,delsign,upsign,uppass,delpass;
- private JLabel user,pass,name,user1,pass1,deluser,upuser,deluserpass,upuserpass;
- private JPasswordField typepass;
- private JPanel logpanel,signpanel,mypanel,delpanel,uppanel;
- private String names [] = {"LogIn","SignUp","Register","Back","Username","Password","Name","Delete","Update","LogOut"};
- private LogInEvents e;
- public LogIn()
- {
- this.frame = new JFrame("LogInGui");
- //buttons
- this.login = new JButton(this.names[0]);
- this.signup = new JButton(this.names[1]);
- this.register = new JButton(this.names[2]);
- this.back = new JButton(this.names[3]);
- this.delete = new JButton(this.names[7]);
- this.update = new JButton(this.names[8]);
- this.logout = new JButton(this.names[9]);
- this.delbutton = new JButton(this.names[7]);
- this.upbutton = new JButton(this.names[8]);
- //textfields
- this.typelog = new JTextField(10);
- this.typesign = new JTextField(10);
- this.typesign1 = new JTextField(10);
- this.typesign2 = new JTextField(10);
- this.delsign = new JTextField(10);
- this.upsign = new JTextField(10);
- this.uppass = new JTextField(10);
- this.delpass = new JTextField(10);
- //panel 1 labels
- this.user = new JLabel(this.names[4]);
- this.pass = new JLabel(this.names[5]);
- this.name = new JLabel(this.names[6]);
- //panel 2 labels
- this.user1 = new JLabel(this.names[4]);
- this.pass1 = new JLabel(this.names[5]);
- //panel del labels
- this.deluser = new JLabel(this.names[4]);
- this.deluserpass = new JLabel(this.names[5]);
- //panel update labels
- this.upuser = new JLabel(this.names[4]);
- this.upuserpass = new JLabel(this.names[5]);
- //passfield
- this.typepass = new JPasswordField();
- //panel LOG IN PANEL 1
- this.logpanel = new JPanel();
- //panel SignUpPanel 2
- this.signpanel = new JPanel();
- //panel My Panel 3
- this.mypanel = new JPanel();
- //panel Del Panel 4
- this.delpanel = new JPanel();
- //panel Update Panel 5
- this.uppanel = new JPanel();
- //events
- this.e = new LogInEvents(this);
- //actionlisteners
- this.back.addActionListener(this.e);
- this.login.addActionListener(this.e);
- this.register.addActionListener(this.e);
- this.signup.addActionListener(this.e);
- this.delete.addActionListener(this.e);
- this.update.addActionListener(this.e);
- this.logout.addActionListener(this.e);
- this.delbutton.addActionListener(this.e);
- this.upbutton.addActionListener(this.e);
- }
- public void LogInPanel(boolean gwapo)
- {
- this.logpanel.setSize(20,20);
- this.logpanel.setLayout(new GridLayout(3,2));
- this.logpanel.add(this.user);
- this.logpanel.add(this.typelog);
- this.logpanel.add(this.pass);
- this.logpanel.add(this.typepass);
- this.logpanel.add(this.login);
- this.logpanel.add(this.signup);
- this.logpanel.setVisible(gwapo);
- this.typelog.requestFocus();
- //frame
- this.frame.setVisible(true);
- this.frame.add(this.logpanel);
- //this.frame.setTitle("LogInPanel");
- this.frame.setResizable(false);
- this.frame.pack();
- this.frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
- }
- public void SignUpPanel(boolean cute)
- {
- this.signpanel.setLayout(new GridLayout(4,3));
- this.signpanel.add(this.name);
- this.signpanel.add(this.typesign);
- this.signpanel.add(this.user1);
- this.signpanel.add(this.typesign1);
- this.signpanel.add(this.pass1);
- this.signpanel.add(this.typesign2);
- this.signpanel.add(this.register);
- this.signpanel.add(this.back);
- this.signpanel.setVisible(cute);
- this.typesign.requestFocus();
- this.frame.setTitle("SignUp");
- this.frame.add(this.signpanel);
- }
- public void MyPanel(boolean cool)
- {
- this.mypanel.setLayout(new GridLayout(1,3));
- this.mypanel.add(this.delete);
- this.mypanel.add(this.update);
- this.mypanel.add(this.logout);
- this.mypanel.setVisible(cool);
- this.frame.add(this.mypanel);
- this.frame.setTitle("MyPanel");
- }
- public void DelPanel(boolean rai)
- {
- this.delpanel.setLayout(new GridLayout(3,2));
- this.delpanel.add(this.deluser);
- this.delpanel.add(this.delsign);
- this.delpanel.add(this.deluserpass);
- this.delpanel.add(this.delpass);
- this.delpanel.add(this.delbutton);
- this.frame.add(this.delpanel);
- this.frame.setTitle("DeletePanel");
- }
- public void UpdatePanel(boolean zel)
- {
- this.uppanel.setLayout(new GridLayout());
- this.uppanel.add(this.upuser);
- this.uppanel.add(this.upsign);
- this.uppanel.add(this.upuserpass);
- this.uppanel.add(this.uppass);
- this.uppanel.add(this.upbutton);
- this.uppanel.setVisible(zel);
- this.frame.add(this.uppanel);
- this.frame.setTitle("UpdatePanel");
- }
- public void showLogPanel(boolean x)
- {
- this.logpanel.setVisible(x);
- }
- public void showDelPanel(boolean y)
- {
- this.delpanel.setVisible(y);
- }
- //button getters
- public JButton getButtonLogIn()
- {
- return this.login;
- }
- public JButton getButtonSignUp()
- {
- return this.signup;
- }
- public JButton getButtonRegister()
- {
- return this.register;
- }
- public JButton getButtonBack()
- {
- return this.back;
- }
- public JButton getButtonDelete()
- {
- return this.delete;
- }
- public JButton getbButtonUpdate()
- {
- return this.update;
- }
- public JButton getButtonLogOut()
- {
- return this.logout;
- }
- public JButton getButtonDelPanel()
- {
- return this.delbutton;
- }
- public JButton getButtonUpdatePanel()
- {
- return this.upbutton;
- }
- //field getters
- public JTextField getFieldUserName()
- {
- return this.typelog;
- }
- public JPasswordField getFieldPassword()
- {
- return this.typepass;
- }
- public JTextField getFieldSignName()
- {
- return this.typesign;
- }
- public JTextField getFieldSignUserName()
- {
- return this.typesign1;
- }
- public JTextField getFieldSignPassword()
- {
- return this.typesign2;
- }
- public JTextField getFieldDelUsername()
- {
- return this.delsign;
- }
- public JTextField getfFieldDelPassword()
- {
- return this.delpass;
- }
- }
Add Comment
Please, Sign In to add comment