if(stmt!=null)
stmt.close();
if(conn!=null)
conn.close();
}catch(SQLException ex)
{
ex.printStackTrace();
}
}
}
//mainframe.java
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import java.sql.*;
public class mainframe extends JFrame implements ActionListener
{
static mainframe s;
static JPanel pan=new JPanel();
static JLabel label1 = new JLabel("用 户");
static JLabel label2 = new JLabel("密 码");
static JTextField textField1 = new JTextField();
static JPasswordField password = new JPasswordField();
static JButton button1 = new JButton("进入系统");
static JRadioButton radioButton1=new JRadioButton(" 管 理
员",true);//“管理员”初始状态被选中
static JRadioButton radioButton2=new JRadioButton("学生");
static JRadioButton radioButton3=new JRadioButton("教师");
ButtonGroup buttonGroup=new ButtonGroup();
public mainframe()
{
JLabel label=new JLabel(new ImageIcon("图片 44.jpg"));
label.setSize(400,400);
pan.add(label);
pan.setLayout(null);
pan.setSize(400,400);
this.setTitle("学籍管理系统");
this.setSize(400,400);
this.setLayout(null);
label1.setBounds(100,25,49,20);
textField1.setBounds(155,24,120,20);