Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
- package application3;
- import java.awt.BorderLayout;
- import java.awt.GridLayout;
- import java.awt.event.ActionEvent;
- import java.awt.event.ActionListener;
- import javax.swing.BoxLayout;
- import javax.swing.JButton;
- import javax.swing.JFrame;
- import javax.swing.JLabel;
- import javax.swing.JPanel;
- import javax.swing.JPasswordField;
- import javax.swing.JTextField;
- /**
- *
- * @author labuser
- */
- public class Application3 {
- /**
- * @param args the command line arguments
- */
- public static void main(String[] args) {
- // TODO code application logic here
- JFrame frame= new JFrame();
- frame.setSize(400, 800);
- frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
- frame.setVisible(true);
- frame.setLayout(new BorderLayout());
- JPanel p = new JPanel(new GridLayout(8,1));
- JLabel login = new JLabel("LOGIN");
- JTextField user = new JTextField();
- JPasswordField pass = new JPasswordField();
- JButton button = new JButton("Login");
- button.addActionListener(new ActionListener() {
- @Override
- public void actionPerformed(ActionEvent e) {
- if (user.getText()== "Admin"){
- Admin admin = new Admin("mixalis", "jsdfhjs", "per", 32);
- String[] s= admin.meth2();
- admin.testMeth();
- }
- else if(user.getText()== "Teacher"){
- Teacher teachr= new Teacher("mixalis", "jsdfhjs", "per", 32);
- String[] t
- }
- else if(user.getText()== "Student"){
- Student stund = new Student("mixalis", "jsdfhjs", "per", 32);
- }
- }
- });
- p.add(user);
- p.add(pass);
- p.add(button);
- frame.add(p, BorderLayout.CENTER);
- frame.add(login, BorderLayout.NORTH);
- frame.pack();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement