Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.awt.BorderLayout;
- import java.awt.Font;
- import java.awt.GridLayout;
- import java.awt.event.ActionEvent;
- import java.awt.event.ActionListener;
- import javax.swing.JButton;
- import javax.swing.JCheckBox;
- import javax.swing.JFrame;
- import javax.swing.JLabel;
- import javax.swing.JList;
- import javax.swing.JPanel;
- import javax.swing.JPasswordField;
- import javax.swing.JRadioButton;
- import javax.swing.JSpinner;
- import javax.swing.JTextArea;
- import javax.swing.JTextField;
- public class BlueSystem extends JFrame implements ActionListener {
- JLabel lbTitle, lbUser, lbPass, lbCPass, lbGender, lbAge, lbUserID;
- JTextField txtUser;
- JPasswordField txtPass, txtCPass;
- JRadioButton rbMale, rbFemale;
- JSpinner spAge;
- JPanel pnlCenter;
- JPanel pnlRadio;
- JPanel pnlSpinner;
- JPanel pnlSouth, pnlButton;
- JCheckBox ckAgree;
- JButton btnLogin, btnRegister, btnCancel;
- public void partNorth(){
- lbTitle = new JLabel(" Login ");
- lbTitle.setHorizontalAlignment(JLabel.CENTER);
- lbTitle.setFont(new Font("Calibri", Font.BOLD, 45));
- add(lbTitle, BorderLayout.NORTH);
- }
- public void partCenter(){
- lbUser = new JLabel("Username:");
- lbPass = new JLabel("Password:");
- txtUser = new JTextField();
- txtPass = new JPasswordField();
- pnlCenter = new JPanel(new GridLayout(3, 5, 0, 40));
- pnlCenter.add(lbUser);
- pnlCenter.add(txtUser);
- pnlCenter.add(lbPass);
- pnlCenter.add(txtPass);
- add(pnlCenter, BorderLayout.CENTER);
- }
- public void partSouth(){
- pnlSouth = new JPanel(new BorderLayout());
- btnLogin = new JButton("Login");
- btnRegister = new JButton("Register");
- pnlButton = new JPanel();
- pnlSouth.add(pnlButton, BorderLayout.SOUTH);
- pnlButton.add(btnLogin);
- pnlButton.add(btnRegister);
- add(pnlSouth, BorderLayout.SOUTH);
- }
- public BlueSystem() {
- setSize(500, 500);
- setTitle("Bluejack Headphone");
- setLocationRelativeTo(null);
- setDefaultCloseOperation(EXIT_ON_CLOSE);
- setVisible(true);
- partNorth();
- partCenter();
- partSouth();
- }
- public static void main(String[] args) {
- new BlueSystem();
- }
- @Override
- public void actionPerformed(ActionEvent arg0) {
- // TODO Auto-generated method stub
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement