Advertisement
sidex15

Untitled

Oct 1st, 2018
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.56 KB | None | 0 0
  1. else if (cx.equals(zx)){
  2. JOptionPane.showMessageDialog(null, "Registered Successfully!");
  3. JOptionPane.showConfirmDialog(null, "Do you want to login now?");
  4.  
  5. JWindow window = new JWindow();
  6. window.getContentPane().add(new JLabel("", new ImageIcon("3.png"),SwingConstants.CENTER));
  7. window.setBounds(450, 100, 320, 240);
  8. window.setSize(650,400);
  9. window.setVisible(true);
  10. try{
  11. Thread.sleep(5000);
  12. }
  13. catch(InterruptedException ex){}
  14. window.dispose();
  15.  
  16.  
  17. JFrame frame = new JFrame("Login");
  18. frame.setVisible(true);
  19. frame.setBounds(450, 100, 185,265);
  20. frame.setResizable(false);
  21. JLabel l, la;
  22.  
  23. l = new JLabel("UserID");
  24. la = new JLabel("Password");
  25. JPanel p =new JPanel();
  26.  
  27.  
  28.  
  29.  
  30. user = new JTextField(15);
  31. pass = new JPasswordField(15);
  32. pass.setEchoChar('•');
  33. pass.addActionListener(this);
  34. user.addActionListener(this);
  35.  
  36. b5 = new JButton("Login");
  37. b6 = new JButton("Cancel");
  38. b5.addActionListener(this);
  39. b5.addActionListener(this);
  40.  
  41.  
  42. p = new JPanel();
  43. //loigin
  44. p.add(l);
  45. p.add(user);
  46. p.add(la);
  47. p.add(pass);
  48. p.add(c);
  49.  
  50. p.add(b5);
  51. p.add(b6);
  52. b5.setBackground(Color.GREEN);
  53. b6.setBackground(Color.ORANGE);
  54. frame.add(p);
  55. c.addActionListener(this);
  56. b5.addActionListener(this);
  57. b6.addActionListener(this);
  58. }
  59. else{
  60. JOptionPane.showMessageDialog(null, "Please Verify your Password");
  61. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement