Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.awt.EventQueue;
- import javax.swing.JFrame;
- import javax.swing.JPanel;
- import javax.swing.border.EmptyBorder;
- import javax.swing.JTextField;
- import javax.swing.JLabel;
- import javax.swing.JOptionPane;
- import java.awt.Font;
- import java.awt.event.ActionEvent;
- import java.awt.event.ActionListener;
- import java.io.BufferedReader;
- import java.io.File;
- import java.io.FileNotFoundException;
- import java.io.FileReader;
- import java.io.IOException;
- import java.util.Scanner;
- import javax.swing.JButton;
- public class userLogin extends JFrame {
- /**
- *
- */
- private static final long serialVersionUID = 1L;
- private JPanel contentPane;
- private JTextField user_tf;
- private JTextField pw_tf;
- private static userLogin frame;
- public static UserRegist registration;
- /**
- * Launch the application.
- */
- public static void main(String[] args) throws IOException {
- EventQueue.invokeLater(new Runnable() {
- public void run() {
- try {
- frame = new userLogin();
- frame.setVisible(true);
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
- });
- }
- /**
- * Create the frame.
- */
- public userLogin() {
- setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
- setBounds(100, 100, 383, 300);
- contentPane = new JPanel();
- contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
- setContentPane(contentPane);
- contentPane.setLayout(null);
- user_tf = new JTextField();
- user_tf.setBounds(153, 80, 143, 20);
- contentPane.add(user_tf);
- user_tf.setColumns(10);
- pw_tf = new JTextField();
- pw_tf.setFont(new Font("Webdings", Font.PLAIN, 11));
- pw_tf.setBounds(153, 139, 143, 20);
- contentPane.add(pw_tf);
- pw_tf.setColumns(10);
- JLabel lblUsername = new JLabel("Username");
- lblUsername.setBounds(37, 83, 91, 14);
- contentPane.add(lblUsername);
- JLabel lblPassword = new JLabel("Password");
- lblPassword.setBounds(37, 142, 91, 14);
- contentPane.add(lblPassword);
- JLabel lblKamiLogin = new JLabel("KAMI Login");
- lblKamiLogin.setFont(new Font("Tahoma", Font.PLAIN, 18));
- lblKamiLogin.setBounds(37, 23, 313, 22);
- contentPane.add(lblKamiLogin);
- JButton btnLogin = new JButton("Login");
- btnLogin.setBounds(207, 207, 89, 23);
- contentPane.add(btnLogin);
- JButton btnRegister = new JButton("Register");
- btnRegister.setBounds(37, 207, 89, 23);
- contentPane.add(btnRegister);
- class register implements ActionListener{
- public void actionPerformed (ActionEvent e){
- frame.dispose();
- registration = new UserRegist();
- registration.setVisible(true);
- }
- }
- btnRegister.addActionListener(new register());
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement