package student;
import java.awt.*;
import javax.swing.*;
public class Class5 extends JFrame{
JPanel jp1,jp2,jp3,jp4;
JLabel jlb1,jlb2,jlb3;
JButton jb1,jb2;
JTextField jtf1;
JPasswordField j;
JRadioButton jr1,jr2,jr3;
ButtonGroup bg;
public static void main(String[] args) {
// TODO Auto-generated method stub
Class5 class5 =new Class5();
}
public Class5(){
jp1=new JPanel();
jp2=new JPanel();
jp3=new JPanel();
jp4=new JPanel();
jb1 =new JButton("登录");
jb2 =new JButton("退出");
jlb1=new JLabel("用户名");
jlb2=new JLabel("密 码");
jlb3=new JLabel("您的身份");
jlb1.setForeground(Color.BLUE);
jlb2.setForeground(Color.BLUE);
jlb3.setFont(new Font("行书",Font.PLAIN,15));
jlb3.setForeground(Color.MAGENTA);
jtf1=new JTextField (15);
j=new JPasswordField (15) ;
jr1=new JRadioButton("学生");
jr2=new JRadioButton("教师");
jr3=new JRadioButton("管理者");
ButtonGroup bg=new ButtonGroup();
bg.add(jr1);
bg.add(jr2);
bg.add(jr3);
jp1.setBackground(null);
jp1.add(jlb1);
jp1.add(jtf1);
jp2.add(jlb2);
jp2.add(j);
jp3.add(jlb3);
jp3.add(jr1);
jp3.add(jr2);
jp3.add(jr3);
jp4.add(jb1);
jp4.add(jb2);
this.setLayout(new GridLayout(4,1));
//加入到JFrame
this.add(jp1);
this.add(jp2);
this.add(jp3);
this.add(jp4);
this.setTitle("学生成绩管理系统");
this.setSize(500,200);
this.setLocation(200,200);
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
this.setResizable(false);
this.setVisible(true);
}
}