[java]代码库
import java.awt
import javax.swing.*;
import java.awt.event.*;
import java.text.SimpleDateFormat;
public class test {
public static void main(String[] args) {
// TODO 自动生成的方法存根
frame fr=new frame("学生信息管理系统-登录");
//frame.add(C1);
}
}
class frame extends JFrame{
JButton J1=new JButton ("登陆");//按钮
JButton J2=new JButton ("退出");
JLabel l1=new JLabel("用户账号");//标签
JLabel l2=new JLabel("用户密码");
JLabel l3=new JLabel("用户身份:");
JTextField T1=new JTextField(10);//框框大小
JTextField T2=new JTextField(10);
String []user={"管理员","学生","老师","教导主任","院领导"};
JComboBox C1=new JComboBox(user);//叠加框
class comboBox extends JPanel{
comboBox(){
C1.setEditable(true);
setLayout(new GridLayout(5,0));
add(C1);
}
}
frame(String str){
super(str);
setSize(400,400);
FlowLayout flow=new FlowLayout(FlowLayout.CENTER,20,20);
this.setLayout(flow);
add(l1);add(T1);add(l2);add(T2);add(l3);add(C1);add(J1);add(J2);
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setVisible(true);
}
}