package com.hu.login;
import java.awt.*;
import javax.swing.*;
public class Loginframe extends JFrame {
/**
*
*/
private static final long serialVersionUID = 1L;
/**
* @param args
*/
JPanel jp1, jp2;
JLabel jl1, jl2;
JButton jb1, jb2;
JTextField jtf;
JPasswordField jpf;
public static void main(String[] args) {
// TODO Auto-generated method stub
Loginframe lf = new Loginframe();
}
public Loginframe() {
jl1 = new JLabel("用户名:");
jtf = new JTextField(10);
jl2 = new JLabel("密 码:");
jpf = new JPasswordField();
jb1 = new JButton("登录");
jb1 = new JButton("取消");
jp1 = new JPanel();
jp2 = new JPanel();
jp2.add(jl1);
jp2.add(jtf);
jp2.add(jl2);
jp2.add(jpf);
jp2.add(jb1);
jp2.add(jb2);
this.setSize(400, 400);
this.setTitle("登录界面");
this.add(jp1, BorderLayout.NORTH);
this.add(jp2, BorderLayout.SOUTH);
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
this.setVisible(true);
}
}