package cn.studentscore.view;
import java.awt.BorderLayout;
import java.awt.EventQueue;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import cn.studentscore.dao.UserDao;
import cn.studentscore.model.ClassType;
import cn.studentscore.model.Student;
import cn.studentscore.model.User;
import cn.studentscore.util.MysqlUtil;
import cn.studentscore.util.StringToolsUtil;
import java.awt.Toolkit;
import javax.swing.GroupLayout;
import javax.swing.GroupLayout.Alignment;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.ImageIcon;
import java.awt.Font;
import javax.swing.LayoutStyle.ComponentPlacement;
import javax.swing.JTextField;
import javax.swing.JPasswordField;
import javax.swing.JButton;
import java.awt.event.ActionListener;
import java.sql.Connection;
import java.awt.event.ActionEvent;
import javax.swing.JRadioButton;
import javax.swing.ButtonGroup;
import javax.swing.JComboBox;
import javax.swing.DefaultComboBoxModel;
import java.awt.Color;
public class LoginFrame extends JFrame {
private JPanel contentPane;
private JTextField userName;
private JPasswordField PassWord;
private MysqlUtil dbUtil = new MysqlUtil();
private UserDao userDao = new UserDao();
private final ButtonGroup buttonGroup = new ButtonGroup();
private JRadioButton sturole;
private JRadioButton adminrole;
private JComboBox roleJcb;
private JComboBox comboBox;
public static String valueString;//存储对象返回的编号
/**
* Launch the application.
*/
public static void main(String[] args) {
EventQueue.invokeLater(new Runnable() {
public void run() {
try {
LoginFrame frame = new LoginFrame();
frame.setVisible(true);
} catch (Exception e) {
e.printStackTrace();
}
}
});
}
/**
* Create the frame.
*/
public LoginFrame() {
setResizable(false);
setFont(new Font("Dialog", Font.BOLD, 14));
setIconImage(Toolkit.getDefaultToolkit()
.getImage(LoginFrame.class.getResource("/cn/studentscore/images/Teacher.png")));
setT