Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
- package ObjectClass;
- import javax.swing.JFrame;
- import javax.swing.JLabel;
- import javax.swing.JPasswordField;
- import javax.swing.JTextField;
- /**
- *
- * @author amferranco
- */
- public class LogInForm {
- private JFrame jfLogin;
- private JLabel jlUser, jlPass;
- private JTextField jtfUser;
- private JPasswordField jtfPass;
- public LogInForm(){
- jfLogin = new JFrame("Log In");
- jlUser = new JLabel("Username");
- jlPass = new JLabel("Password");
- jtfUser=new JTextField();
- jtfPass=new JPasswordField();
- }
- 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);
- jfLogin.setVisible(true);
- }
- }
- /*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
- package TestClass;
- import ObjectClass.LogInForm;
- /**
- *
- * @author amferranco
- */
- public class TestLogIn {
- public static void main(String[] args){
- new LogInForm().launch();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement