Advertisement
Guest User

Untitled

a guest
Mar 28th, 2019
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.17 KB | None | 0 0
  1. /*
  2. * To change this license header, choose License Headers in Project Properties.
  3. * To change this template file, choose Tools | Templates
  4. * and open the template in the editor.
  5. */
  6. package application3;
  7.  
  8. import java.awt.BorderLayout;
  9. import java.awt.GridLayout;
  10. import java.awt.event.ActionEvent;
  11. import java.awt.event.ActionListener;
  12. import javax.swing.BoxLayout;
  13. import javax.swing.JButton;
  14. import javax.swing.JFrame;
  15. import javax.swing.JLabel;
  16. import javax.swing.JPanel;
  17. import javax.swing.JPasswordField;
  18. import javax.swing.JTextField;
  19.  
  20. /**
  21. *
  22. * @author labuser
  23. */
  24. public class Application3 {
  25.  
  26. /**
  27. * @param args the command line arguments
  28. */
  29. public static void main(String[] args) {
  30. // TODO code application logic here
  31. JFrame frame= new JFrame();
  32. frame.setSize(400, 800);
  33. frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  34. frame.setVisible(true);
  35.  
  36. frame.setLayout(new BorderLayout());
  37.  
  38. JPanel p = new JPanel(new GridLayout(8,1));
  39. JLabel login = new JLabel("LOGIN");
  40. JTextField user = new JTextField();
  41. JPasswordField pass = new JPasswordField();
  42. JButton button = new JButton("Login");
  43.  
  44. button.addActionListener(new ActionListener() {
  45. @Override
  46. public void actionPerformed(ActionEvent e) {
  47. if (user.getText()== "Admin"){
  48. Admin admin = new Admin("mixalis", "jsdfhjs", "per", 32);
  49. String[] s= admin.meth2();
  50. admin.testMeth();
  51. }
  52. else if(user.getText()== "Teacher"){
  53. Teacher teachr= new Teacher("mixalis", "jsdfhjs", "per", 32);
  54. String[] t
  55. }
  56. else if(user.getText()== "Student"){
  57. Student stund = new Student("mixalis", "jsdfhjs", "per", 32);
  58. }
  59. }
  60. });
  61.  
  62.  
  63. p.add(user);
  64. p.add(pass);
  65. p.add(button);
  66.  
  67.  
  68. frame.add(p, BorderLayout.CENTER);
  69. frame.add(login, BorderLayout.NORTH);
  70.  
  71. frame.pack();
  72.  
  73. }
  74.  
  75. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement