/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package com.mis.ui.internalframe;
import com.mis.model.Student;
import static com.mis.ui.dialog.AddStudentDialog.RET_CANCEL;
import static com.mis.ui.dialog.AddStudentDialog.RET_OK;
import static com.mis.ui.dialog.AddStudentDialog.sno;
import com.mis.util.DaoFactory;
import com.mis.util.Tools;
import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.Image;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.imageio.ImageIO;
import javax.swing.ComboBoxModel;
import javax.swing.DefaultComboBoxModel;
import javax.swing.ImageIcon;
import javax.swing.JEditorPane;
import javax.swing.JFileChooser;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTextField;
import javax.swing.filechooser.FileNameExtensionFilter;
/**
*
* @author Administrator
*/
public class StudentManageInternalFrame extends javax.swing.JInternalFrame {
/**
* Creates new form StudentManageInternalFrame
*/
public StudentManageInternalFrame() {
initComponents();
DisplayStudentDetails();
}
/**
* This method is called from within the constructor to initialize the form.
* WARNING: Do NOT modify this code. The content of this method is always
* regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
sexButtonGroup1 = new javax.swing.ButtonGroup();
sexButtonGroup2 = new javax.swing.ButtonGroup();
tabbedPane = new javax.swing.JTabbedPane();
jPanel1 = new javax.swing.JPanel();
jPanel3 = new javax.swing.JPanel();
jPanel4 = new javax.swing.JPanel();
jLabel7 = new javax.swing.JLabel();
jLabel8 = new javax.swing.JLabel();
jLabel9 = new javax.swing.JLabel();
jLabel10 = new javax.swing.JLabel();
jLabel13 = new javax.swing.JLabel();
jLabel11 = new javax.swing.JLabel();
jPanel5 = new javax.swing.JPanel();
maleRadioButton = new javax.swing.JRadioButton();
femaleRadioButton = new javax.swing.JRadioButton();
savggradeText = new javax.swing.JTextField();
snameText = new javax.swing.JTextField();
sageText = new javax.swing.JTextField();
sdeptComboBox = new javax.swing.JComboBox<>();
snoText = new javax.swing.JTextField();
jPanel6 = new javax.swing.JPanel();
picLabel = new javax.swing.JLabel();
selectBtn = new javax.swing.JButton();
clearBtn = new javax.swing.JButton();
addStudentButton = new javax.swing.JButton();
resetStudentButton = new javax.swing.JButton();
jPanel2 = new javax.swing.JPanel();
jPanel7 = new javax.swing.JPanel();
jPanel8 = new javax.swing.JPanel();
jLabel12 = new javax.swing.JLabel();
jLabel14 = new javax.swing.JLabel();
jLabel15 = new javax.swing.JLabel();
jLabel16 = new javax.swing.JLabel();
jLabel17 = new javax.swing.JLabel();
jLabel18 = new javax.swing.JLabel();
jPanel9 = new javax.swing.JPanel();
maleRadioButton1 = new javax.swing.JRadioButton();
femaleRadioButton1 = new javax.swing.JRadioButton();
savggradeText1 = new javax.swing.JTextField();
snameText1 = new javax.swing.JTextField();
sageText1 = new javax.swing.JTextField();
sdeptComboBox1 = new javax.swing.JComboBox<>();
snoText1 = new javax.swing.JTextField();
jPanel10 = new javax.swing.JPanel();
picLabel1 = new javax.swing.JLabel();
selectBtn1 = new javax.swing.JButton();
clearBtn1 = new javax.swing.JButton();
updateStudentButton = new javax.swing.JButton();
deleteStudentButton = new javax.swing.JButton();
refreshButton = new javax.swing.JButton();
setClosable(true);
setIconifiable(true);
setMaximizable(true);
setResizable(true);
setTitle("学生信息管理");
tabbedPane.setToolTipText("");
jPanel1.setToolTipText("");
jPanel1.setPreferredSize(new java.awt.Dimension(600, 400));
jPanel3.setBorder(javax.swing.BorderFactory.createTitledBorder("学生详细信息"));
jLabel7.setFont(new java.awt.Font("宋体", 1, 18)); // NOI18N
jLabel7.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
jLabel7.setText("学号:");
jLabel8.setFont(new java.awt.Font("宋体", 1, 18)); // NOI18N
jLabel8.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
jLabel8.setText("姓名:");
jLabel9.setFont(new java.awt.Font("宋体", 1, 18)); // NOI18N
jLabel9.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
jLabel9.setText("性别:");
jLabel10.setFont(new java.awt.Font("宋体", 1, 18)); // NOI18N
jLabel10.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
jLabel10.setText("年龄:");
jLabel13.setFont(new java.awt.Font("宋体", 1, 18)); // NOI18N
jLabel13.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
jLabel13.setText("平均成绩:");
jLabel11.setFont(new java.awt.Font("宋体", 1, 18)); // NOI18N
jLabel11.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
jLabel11.setText("系部:");
javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);
jPanel4.setLayout(jPanel4Layout);
jPanel4Layout.setHorizontalGroup(
jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel8, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jLabel9, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jLabel7, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jLabel10, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jLabel13, javax.swing.GroupLayout.DEFAULT_SIZE, 103, Short.MAX_VALUE)
.addComponent(jLabel11, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
);
jPanel4Layout.setVerticalGroup(
jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel4Layout.createSequentialGroup()
.addContainerGap()
.addComponent(jLabel7)
.addGap(32, 32, 32)
.addComponent(jLabel8)
.addGap(33, 33, 33)
.addComponent(jLabel9)
.addGap(28, 28, 28)
.addComponent(jLabel10)
.addGap(33, 33, 33)
.addComponent(jLabel11)
.addGap(32, 32, 32)
.addComponent(jLabel13)
.addGap(24, 24, 24))
);
sexButtonGroup1.add(maleRadioButton);
maleRadioButton.setSelected(true);
maleRadioButton.setText("男");
sexButtonGroup1.add(femaleRadioButton);
femaleRadioButton.setText("女");
sdeptComboBox.setModel(comboBoxModel);
javax.swing.GroupLayout jPanel5Layout = new javax.swing.GroupLayout(jPanel5);
jPanel5.setLayout(jPanel5Layout);
jPanel5Layout.setHorizontalGro