📄 studentinfopanel.java
字号:
package cn.st.ui;
import java.awt.Color;
import java.awt.Rectangle;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
import java.text.ParseException;
import java.util.Date;
import java.util.List;
import javax.swing.JButton;
import javax.swing.JComboBox;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTable;
import javax.swing.JTextField;
import javax.swing.ListSelectionModel;
import javax.swing.event.ListSelectionEvent;
import javax.swing.event.ListSelectionListener;
import javax.swing.table.DefaultTableModel;
import org.jdesktop.swingx.DateSelectionListener;
import org.jdesktop.swingx.event.DateSelectionEvent;
import cn.st.data.ClassInfo;
import cn.st.data.CoursesInfo;
import cn.st.data.DataBaseConnector;
import cn.st.data.KeMuChengJi;
import cn.st.data.StudentInfo;
import cn.st.util.DateUtil;
import cn.st.util.OtherUtil;
import com.db4o.ObjectContainer;
import com.db4o.ObjectSet;
public class StudentInfoPanel extends JPanel implements ActionListener,
ItemListener, ListSelectionListener, DateSelectionListener {
private static final long serialVersionUID = 1L;
private JLabel jLName = null;
private JLabel jLSex = null;
private JLabel jLDate = null;
private JLabel jLFatherName = null;
private JLabel jLFatherPhone = null;
private JLabel jLNumber = null;
private JLabel jLMinZhu = null;
private JLabel jLAdder = null;
private JLabel jLMotherName = null;
private JLabel jLMotherPhone = null;
private JLabel jLZip = null;
private JLabel jLBanJi = null;
private JLabel jLZhuanYe = null;
private JTextField jTName = null;
private JTextField jTFatherName = null;
private JTextField jTFatherPhone = null;
private JTextField jTZip = null;
private JComboBox jCSex = null;
private JTextField jTBirthday = null;
private JTextField jTZhuangYe = null;
private JTextField jTNumber = null;
private JTextField jTMingZhu = null;
private JTextField jTAddress = null;
private JTextField jTMotherName = null;
private JTextField jTMotherPhone = null;
private JButton jBFirst = null;
private JButton jBBackUp = null;
private JButton jBNext = null;
private JButton jBLast = null;
private JButton jBNew = null;
private JButton jBModify = null;
private JButton jBDelete = null;
private JButton jBChengJi = null;
private JPanel jPChengJi = null;
private JScrollPane jScrollPane = null;
private JTable jTable = null;
private JButton jBNewChengJi = null;
private JButton jBModifyChengJi = null;
private JButton jBDeleteChengJi = null;
private JLabel jLKeChengHao = null;
private JLabel jLKeChengName = null;
private JLabel jLchengJi = null;
private JLabel jLRemark = null;
private JTextField jTChengJi = null;
private JTextField jTKeChengNum = null;
private JTextField jTRemark = null;
private OtherUtil otherUtil = new OtherUtil(); // @jve:decl-index=0:
List<StudentInfo> list = null; // @jve:decl-index=0:
private JLabel jLJiGuan = null;
private JTextField jTJiGuan = null;
private StudentInfo stuInfo = null;
private KeMuChengJi keMuChengJi = null;
/**
* 进行上一个,下一个时的计数器
*/
int count = 0;
private JComboBox jCKeChengName = null;
private ClassInfo classInfo = null;
private JTextField jTBanJi = null;
private CoursesInfo ci = null;
private final String NEW_CJ = "newCJ";
private final String NEW_CJ_ENTER = "newCJEnter";
private final String MODIFY_CJ = "modifyCJ";
private final String MODIFY_CJ_ENTER = "modifyCJEnter";
private final String DELETE_CJ = "deleteCJ";
private final String CHENG_JI_MANAGE = "cjManage";
private final String CALENDAL = "calendal";
private JButton jBCalendar = null;
/**
* This is the default constructor
*/
public StudentInfoPanel() {
super();
initComponents();
initialize();
}
/**
* This method initializes this
*
* @return void
*/
private void initialize() {
jLJiGuan = new JLabel();
jLJiGuan.setBounds(new Rectangle(15, 225, 80, 18));
jLJiGuan.setText("籍贯:");
jLZhuanYe = new JLabel();
jLZhuanYe.setBounds(new Rectangle(15, 196, 81, 18));
jLZhuanYe.setText("专业:");
jLBanJi = new JLabel();
jLBanJi.setBounds(new Rectangle(241, 167, 81, 18));
jLBanJi.setText("班级:");
jLZip = new JLabel();
jLZip.setBounds(new Rectangle(15, 167, 81, 18));
jLZip.setText("邮编:");
jLMotherPhone = new JLabel();
jLMotherPhone.setBounds(new Rectangle(241, 136, 81, 18));
jLMotherPhone.setText("母亲电话:");
jLMotherName = new JLabel();
jLMotherName.setBounds(new Rectangle(241, 105, 81, 18));
jLMotherName.setText("母亲姓名:");
jLAdder = new JLabel();
jLAdder.setBounds(new Rectangle(241, 76, 81, 18));
jLAdder.setText("家庭地址:");
jLMinZhu = new JLabel();
jLMinZhu.setBounds(new Rectangle(241, 46, 81, 18));
jLMinZhu.setText("民族:");
jLNumber = new JLabel();
jLNumber.setBounds(new Rectangle(241, 14, 81, 18));
jLNumber.setText("学号:");
jLFatherPhone = new JLabel();
jLFatherPhone.setBounds(new Rectangle(15, 136, 81, 18));
jLFatherPhone.setText("父亲电话:");
jLFatherName = new JLabel();
jLFatherName.setBounds(new Rectangle(15, 105, 81, 18));
jLFatherName.setText("父亲姓名:");
jLDate = new JLabel();
jLDate.setBounds(new Rectangle(15, 76, 81, 18));
jLDate.setText("出生日期:");
jLSex = new JLabel();
jLSex.setBounds(new Rectangle(15, 46, 81, 18));
jLSex.setText("性别:");
jLName = new JLabel();
jLName.setText("姓名:");
jLName.setBounds(new Rectangle(15, 14, 81, 18));
this.setSize(508, 424);
this.setLayout(null);
this.add(jLName, null);
this.add(jLSex, null);
this.add(jLDate, null);
this.add(jLFatherName, null);
this.add(jLFatherPhone, null);
this.add(jLNumber, null);
this.add(jLMinZhu, null);
this.add(jLAdder, null);
this.add(jLMotherName, null);
this.add(jLMotherPhone, null);
this.add(jLZip, null);
this.add(jLBanJi, null);
this.add(jLZhuanYe, null);
this.add(getJTName(), null);
this.add(getJTFatherName(), null);
this.add(getJTFatherPhone(), null);
this.add(getJTZip(), null);
this.add(getJCSex(), null);
this.add(getJTBirthday(), null);
this.add(getJTZhuangYe(), null);
this.add(getJTNumber(), null);
this.add(getJTMingZhu(), null);
this.add(getJTAddress(), null);
this.add(getJTMotherName(), null);
this.add(getJTMotherPhone(), null);
this.add(getJBFirst(), null);
this.add(getJBBackUp(), null);
this.add(getJBNext(), null);
this.add(getJBLast(), null);
this.add(getJBNew(), null);
this.add(getJBModify(), null);
this.add(getJBDelete(), null);
this.add(getJBChengJi(), null);
this.add(getJPChengJi(), null);
this.add(jLJiGuan, null);
this.add(getJTJiGuan(), null);
this.add(getJTBanJi(), null);
this.add(getJBCalendar(), null);
this.getJPChengJi().setVisible(false);
}
/**
* This method initializes jTName
*
* @return javax.swing.JTextField
*/
private JTextField getJTName() {
if (jTName == null) {
jTName = new JTextField();
jTName.setBounds(new Rectangle(106, 14, 120, 18));
jTName.setEnabled(false);
}
return jTName;
}
/**
* This method initializes jTFatherName
*
* @return javax.swing.JTextField
*/
private JTextField getJTFatherName() {
if (jTFatherName == null) {
jTFatherName = new JTextField();
jTFatherName.setBounds(new Rectangle(106, 105, 120, 18));
jTFatherName.setEnabled(false);
}
return jTFatherName;
}
/**
* This method initializes jTFatherPhone
*
* @return javax.swing.JTextField
*/
private JTextField getJTFatherPhone() {
if (jTFatherPhone == null) {
jTFatherPhone = new JTextField();
jTFatherPhone.setBounds(new Rectangle(106, 136, 120, 18));
jTFatherPhone.setEnabled(false);
}
return jTFatherPhone;
}
/**
* This method initializes jTZip
*
* @return javax.swing.JTextField
*/
private JTextField getJTZip() {
if (jTZip == null) {
jTZip = new JTextField();
jTZip.setBounds(new Rectangle(106, 167, 120, 18));
jTZip.setEnabled(false);
}
return jTZip;
}
/**
* This method initializes jCSex
*
* @return javax.swing.JComboBox
*/
private JComboBox getJCSex() {
if (jCSex == null) {
jCSex = new JComboBox();
jCSex.setBounds(new Rectangle(106, 46, 120, 18));
jCSex.setEnabled(false);
jCSex.addItem("男");
jCSex.addItem("女");
jCSex.addItemListener(this);
jCSex.setSelectedIndex(0);
}
return jCSex;
}
/**
* This method initializes jTBirthday
*
* @return javax.swing.JTextField
*/
public JTextField getJTBirthday() {
if (jTBirthday == null) {
jTBirthday = new JTextField();
jTBirthday.setBounds(new Rectangle(106, 76, 101, 18));
jTBirthday.setEnabled(false);
}
return jTBirthday;
}
/**
* This method initializes jTZhuangYe
*
* @return javax.swing.JTextField
*/
private JTextField getJTZhuangYe() {
if (jTZhuangYe == null) {
jTZhuangYe = new JTextField();
jTZhuangYe.setBounds(new Rectangle(106, 196, 120, 18));
jTZhuangYe.setEnabled(false);
}
return jTZhuangYe;
}
/**
* This method initializes jTNumber
*
* @return javax.swing.JTextField
*/
private JTextField getJTNumber() {
if (jTNumber == null) {
jTNumber = new JTextField();
jTNumber.setBounds(new Rectangle(330, 14, 165, 18));
jTNumber.setEnabled(false);
}
return jTNumber;
}
/**
* This method initializes jTMingZhu
*
* @return javax.swing.JTextField
*/
private JTextField getJTMingZhu() {
if (jTMingZhu == null) {
jTMingZhu = new JTextField();
jTMingZhu.setBounds(new Rectangle(330, 46, 165, 18));
jTMingZhu.setEnabled(false);
}
return jTMingZhu;
}
/**
* This method initializes jTAddress
*
* @return javax.swing.JTextField
*/
private JTextField getJTAddress() {
if (jTAddress == null) {
jTAddress = new JTextField();
jTAddress.setBounds(new Rectangle(330, 76, 165, 18));
jTAddress.setEnabled(false);
}
return jTAddress;
}
/**
* This method initializes jTMotherName
*
* @return javax.swing.JTextField
*/
private JTextField getJTMotherName() {
if (jTMotherName == null) {
jTMotherName = new JTextField();
jTMotherName.setBounds(new Rectangle(330, 105, 165, 18));
jTMotherName.setEnabled(false);
}
return jTMotherName;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -