Advertisement
Guest User

BlueJack

a guest
May 13th, 2017
142
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.26 KB | None | 0 0
  1. import java.awt.BorderLayout;
  2. import java.awt.Font;
  3. import java.awt.GridLayout;
  4. import java.awt.event.ActionEvent;
  5. import java.awt.event.ActionListener;
  6.  
  7. import javax.swing.JButton;
  8. import javax.swing.JCheckBox;
  9. import javax.swing.JFrame;
  10. import javax.swing.JLabel;
  11. import javax.swing.JList;
  12. import javax.swing.JPanel;
  13. import javax.swing.JPasswordField;
  14. import javax.swing.JRadioButton;
  15. import javax.swing.JSpinner;
  16. import javax.swing.JTextArea;
  17. import javax.swing.JTextField;
  18.  
  19. public class BlueSystem extends JFrame implements ActionListener {
  20.  
  21. JLabel lbTitle, lbUser, lbPass, lbCPass, lbGender, lbAge, lbUserID;
  22. JTextField txtUser;
  23. JPasswordField txtPass, txtCPass;
  24. JRadioButton rbMale, rbFemale;
  25. JSpinner spAge;
  26. JPanel pnlCenter;
  27. JPanel pnlRadio;
  28. JPanel pnlSpinner;
  29. JPanel pnlSouth, pnlButton;
  30. JCheckBox ckAgree;
  31. JButton btnLogin, btnRegister, btnCancel;
  32.  
  33. public void partNorth(){
  34.  
  35. lbTitle = new JLabel(" Login ");
  36. lbTitle.setHorizontalAlignment(JLabel.CENTER);
  37. lbTitle.setFont(new Font("Calibri", Font.BOLD, 45));
  38. add(lbTitle, BorderLayout.NORTH);
  39.  
  40. }
  41.  
  42. public void partCenter(){
  43.  
  44. lbUser = new JLabel("Username:");
  45. lbPass = new JLabel("Password:");
  46.  
  47. txtUser = new JTextField();
  48. txtPass = new JPasswordField();
  49.  
  50. pnlCenter = new JPanel(new GridLayout(3, 5, 0, 40));
  51.  
  52. pnlCenter.add(lbUser);
  53. pnlCenter.add(txtUser);
  54.  
  55. pnlCenter.add(lbPass);
  56. pnlCenter.add(txtPass);
  57.  
  58. add(pnlCenter, BorderLayout.CENTER);
  59.  
  60. }
  61.  
  62. public void partSouth(){
  63.  
  64. pnlSouth = new JPanel(new BorderLayout());
  65. btnLogin = new JButton("Login");
  66. btnRegister = new JButton("Register");
  67. pnlButton = new JPanel();
  68.  
  69. pnlSouth.add(pnlButton, BorderLayout.SOUTH);
  70. pnlButton.add(btnLogin);
  71. pnlButton.add(btnRegister);
  72.  
  73. add(pnlSouth, BorderLayout.SOUTH);
  74.  
  75. }
  76.  
  77.  
  78.  
  79. public BlueSystem() {
  80.  
  81. setSize(500, 500);
  82. setTitle("Bluejack Headphone");
  83. setLocationRelativeTo(null);
  84. setDefaultCloseOperation(EXIT_ON_CLOSE);
  85. setVisible(true);
  86.  
  87.  
  88. partNorth();
  89. partCenter();
  90. partSouth();
  91. }
  92.  
  93. public static void main(String[] args) {
  94. new BlueSystem();
  95. }
  96.  
  97. @Override
  98. public void actionPerformed(ActionEvent arg0) {
  99. // TODO Auto-generated method stub
  100.  
  101. }
  102. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement