java学生信息管理系统界面代码
package edu.gzu.stuManager; import java.awt.Color; import java.awt.Container; import java.awt.Cursor; import java.awt.Font; import java.awt.Image; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.ImageIcon; import javax.swing.JButton; import javax.swing.JCheckBox; import javax.swing.JComboBox; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JOptionPane; import javax.swing.JPasswordField; import javax.swing.JRootPane; import javax.swing.JTextField; public class StudentMainView extends JFrame{ private static final long serialVersionUID = -6788045638380819221L; //用户名 private JTextField ulName; //密码 private JPasswordField ulPasswd; //小容器 private JLabel j1; private JLabel j2; private JLabel j3; private JLabel j4; private JLabel j5; private JLabel j6; //小按钮 private JButton b1; private JButton b2; //复选框 private JCheckBox c1; private JCheckBox c2; //列表框 private JComboBox cb1; /** * 初始化 QQ 登录页面 * */ public StudentMainView (){ //设置登录窗口标题 this.setTitle(“学生信息管理系统“); //去掉窗口的装饰(边框) // this.setUndecorated(true); //采用指定的窗口装饰风格 this.getRootPane().setWindowDecorationStyle(JRootP ane.NONE); //窗体组件初始化 init(); this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE ); //设置布局为绝对定位******* this.setLayout(null); this.setBounds(100, 100, 1055, 765); //设置窗体的图标 Image img0 = new ImageIcon(“F:/1.jpg“).getImage(); this.setIconImage(img0); //窗体大小不能改变 this.setResizable(false); //居中显示 this.setLocationRelativeTo(null); //窗体显示 this.setVisible(true); } /** * 窗体组件初始化 * */ public void init(){ Container container = this.getContentPane(); j1 = new JLabel(); //设置背景图片 Image img1 = new ImageIcon(“C:\\Users\\hasee\\Desktop\\123\\2.jpg“) .getImage(); j1.setIcon(new ImageIcon(img1)); j1.setBounds(0,0, 1055, 765); //LOGE 设定 j2 = new JLabel(); Image img2 = new ImageIcon(“D:/hdimg.png“).getImage(); j2.setIcon(new ImageIcon(img2)); j2.setBounds(40, 95, 50, 53); //用户名输入框//注册账号 j3 = new JLabel(“用户名“); ulName = new JTextField(); ulName.setBounds(450, 200, 200, 35); //注册账号 j3 = new JLabel(“用户名:“); j3.setFont(new Font(“宋体“, Font.PLAIN, 25)); j3.setBounds(330, 162, 100, 120); //密码输入框 ulPasswd = new JPasswordField(); ulPasswd.setBounds(450, 250, 200, 35); //找回密码 j4= new JLabel(“密 码:“); j4.setSize(12, 45); j4.setFont(new Font(“宋体“, Font.PLAIN, 25)); j4.setBounds(330, 206, 100, 120); j5= new JLabel(“欢迎登陆学生信息管理系统!“); j5.setSize(500, 100); j5.setFont(new Font(“宋体“, Font.PLAIN, 50)); j5.setBounds(220, 0, 1000, 220); j6= new JLabel(“我的身份是:“); j6.setSize(50, 100); j6.setFont(new Font(“宋体“, Font.PLAIN, 25)); j6.setBounds(330, 210, 500, 220); //记住密码 c1 = new JCheckBox(“记住密码“); c1.setBounds(330, 450, 150, 40); //自动登陆 c2 = new JCheckBox(“自动登陆“); c2.setBounds(500, 450, 150, 40); //用户登陆状态选择 cb1 = new JComboBox(); cb1.addItem(“学生“); cb1.addItem(“老师“); cb1.addItem(“管理员“); cb1.setBounds(550, 300, 100, 40); //登陆按钮 b1 = new JButton(“登录“); //设置字体和颜色和手形指针 b1.setFont(new Font(“宋体“, Font.PLAIN, 15)); b1.setForeground(Color.RED); b1.setCursor(Cursor.getPredef