Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import javax.swing.*;
- public class LogInForm{
- private JFrame jfLogIn;
- private JLabel jlUser, jlPass;
- private JTextField jtfUser;
- private JPasswordField jpPass;
- private JButton jbOk, jbCancel;
- public LogInForm(){
- jfLogIn = new JFrame("Log In");
- jlUser = new JLabel("UserName: ");
- jlPass = new JLabel("Password: ");
- jtfUser = new JTextField();
- jpPass = new JPasswordField();
- jbOk = new JButton("Ok");
- jbCancel = new JButton("Cancel");
- }
- public void launch(){
- jfLogIn.setLayout(null);
- jfLogIn.setBounds(160, 150, 400, 300);
- jfLogIn.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
- jlUser.setBounds(30 ,50 ,100 ,30);
- jfLogIn.add(jlUser);
- jlPass.setBounds(30 ,100 ,100 ,30);
- jfLogIn.add(jlPass);
- jtfUser.setBounds(150, 50, 200, 30);
- jfLogIn.add(jtfUser);
- jpPass.setBounds(150, 100, 200, 30);
- jfLogIn.add(jpPass);
- jbOk.setBounds(50, 150, 100, 30);
- jfLogIn.add(jbOk);
- jbCancel.setBounds(250, 150, 100, 30);
- jfLogIn.add(jbCancel);
- jfLogIn.setVisible(true);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement