package appstu.view;
import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.util.Calendar;
import java.util.Collection;
import java.util.Iterator;
import java.util.Locale;
import java.util.Vector;
import javax.swing.DefaultDesktopManager;
import javax.swing.JButton;
import javax.swing.JComboBox;
import javax.swing.JInternalFrame;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JSplitPane;
import javax.swing.JTable;
import javax.swing.JTextField;
import javax.swing.table.DefaultTableModel;
import appstu.model.Obj_gradeinfo_sub;
import appstu.util.RetrieveObject;
public class JF_view_gradesub extends JInternalFrame {
/**
*
*/
private static final long serialVersionUID = -537038919964506695L;
BorderLayout borderLayout1 = new BorderLayout();
JSplitPane jSplitPane1 = new JSplitPane();
JScrollPane jScrollPane2 = new JScrollPane();
JPanel jPanel2 = new JPanel();
FlowLayout flowLayout1 = new FlowLayout();
JTable jTable1 = new JTable();
JLabel jLabel1 = new JLabel();
JComboBox jComboBox1 = new JComboBox();
JLabel jLabel2 = new JLabel();
JComboBox jComboBox2 = new JComboBox();
JButton jBadd = new JButton();
JButton jBsave = new JButton();
JButton jBexit = new JButton();
JScrollPane jScrollPane1 = new JScrollPane();
JTable jTable2 = new JTable();
// ////////////////
String classid[] = null;
String examkindid[] = null;
String examkindname[] = null;
String subjectcode[] = null;
String subjectname[] = null;
JLabel jLabel3 = new JLabel();
JTextField jTextField1 = new JTextField();
JButton jBdel = new JButton();
public JF_view_gradesub() {
try {
jbInit();
initialize();
} catch (Exception exception) {
exception.printStackTrace();
}
}
private void jbInit() throws Exception {
getContentPane().setLayout(borderLayout1);
jSplitPane1.setOrientation(JSplitPane.VERTICAL_SPLIT);
jSplitPane1.setDividerSize(10);
jPanel2.setLayout(flowLayout1);
jLabel1.setText("选择班级:");
jLabel2.setText("考试种类:");
jBadd.setText("添加");
jBadd.addActionListener(new JF_view_gradesub_jBadd_actionAdapter(this));
jBsave.setText("存盘");
jBsave.addActionListener(new JF_view_gradesub_jBsave_actionAdapter(this));
jBexit.setText("退出");
jBexit.addActionListener(new JF_view_gradesub_jBexit_actionAdapter(this));
this.setClosable(true);
jComboBox2.addItemListener(new JF_view_gradesub_jComboBox2_itemAdapter(this));
jLabel3.setText("考试日期:");
jTextField1.setPreferredSize(new Dimension(96, 26));
jTextField1.setText("");
flowLayout1.setAlignment(FlowLayout.RIGHT);
jTable1.addMouseListener(new JF_view_gradesub_jTable1_mouseAdapter(this));
jBdel.setText("删除");
jBdel.addActionListener(new JF_view_gradesub_jBdel_actionAdapter(this));
jSplitPane1.add(jScrollPane2, JSplitPane.TOP);
jSplitPane1.add(jScrollPane1, JSplitPane.BOTTOM);
jScrollPane1.getViewport().add(jTable2);
jPanel2.add(jLabel3);
jPanel2.add(jTextField1);
jPanel2.add(jLabel2);
jPanel2.add(jComboBox1);
jPanel2.add(jLabel1);
jPanel2.add(jComboBox2);
jPanel2.add(jBadd);
jPanel2.add(jBdel);
jPanel2.add(jBsave);
jPanel2.add(jBexit);
jScrollPane2.getViewport().add(jTable1);
this.getContentPane().add(jPanel2, java.awt.BorderLayout.NORTH);
this.getContentPane().add(jSplitPane1, java.awt.BorderLayout.CENTER);
setSize(700, 500);
setVisible(true);
jSplitPane1.setDividerLocation(159);
}
public void initialize() {
RetrieveObject retrieve = new RetrieveObject();
java.util.Vector vdata = new java.util.Vector();
String sqlStr = null;
java.util.Collection collection = null;
java.util.Iterator iterator = null;
sqlStr = "SELECT * FROM tb_examkinds";
collection = retrieve.getTableCollection(sqlStr);
iterator = collection.iterator();
examkindid = new String[collection.size()];
examkindname = new String[collection.size()];
int i = 0;
while (iterator.hasNext()) {
vdata = (java.util.Vector) iterator.next();
examkindid[i] = String.valueOf(vdata.get(0));
examkindname[i] = String.valueOf(vdata.get(1));
jComboBox1.addItem(vdata.get(1));
i++;
}
sqlStr = "select * from tb_classinfo";
collection = retrieve.getTableCollection(sqlStr);
iterator = collection.iterator();
classid = new String[collection.size()];
i = 0;
while (iterator.hasNext()) {
vdata = (java.util.Vector) iterator.next();
classid[i] = String.valueOf(vdata.get(0));
jComboBox2.addItem(vdata.get(2));
i++;
}
sqlStr = "select * from tb_subject";
collection = retrieve.getTableCollection(sqlStr);
iterator = collection.iterator();
subjectcode = new String[collection.size()];
subjectname = new String[collection.size()];
i = 0;
while (iterator.hasNext()) {
vdata = (java.util.Vector) iterator.next();
subjectcode[i] = String.valueOf(vdata.get(0));
subjectname[i] = String.valueOf(vdata.get(1));
i++;
}
long nCurrentTime = System.currentTimeMillis();
java.util.Calendar calendar = java.util.Calendar.getInstance(new Locale("CN"));
calendar.setTimeInMillis(nCurrentTime);
int year = calendar.get(Calendar.YEAR);
int month = calendar.get(Calendar.MONTH) + 1;
int day = calendar.get(Calendar.DAY_OF_MONTH);
String mm, dd;
if (month < 10) {
mm = "0" + String.valueOf(month);
} else {
mm = String.valueOf(month);
}
if (day < 10) {
dd = "0" + String.valueOf(day);
} else {
dd = String.valueOf(day);
}
java.sql.Date date = java.sql.Date.valueOf(year + "-" + mm + "-" + dd);
jTextField1.setText(String.valueOf(date));
}
public void jComboBox2_itemStateChanged(ItemEvent e) {
String cid = classid[jComboBox2.getSelectedIndex()];
DefaultTableModel tablemodel = null;
String[] name = { "学生编号", "班级编号", "学生姓名", "性别", "年龄", "家庭住址", "联系电话" };
String sqlStr = "select * from tb_studentinfo where classID = '" + cid + "'";
appstu.util.RetrieveObject bdt = new appstu.util.RetrieveObject();
tablemodel = bdt.getTableModel(name, sqlStr);
jTable1.setModel(tablemodel);
jTable1.setRowHeight(24);
}
public void jBadd_actionPerformed(ActionEvent e) {
int currow;
currow = jTable1.getSelectedRow();
if (currow >= 0) {
DefaultTableModel tablemodel = null;
String[] name = { "学生编号", "学生姓名", "考试类别", "考试科目", "考试成绩", "考试时间" };
tablemodel = new DefaultTableModel(name, 0);
String sqlStr = null;
Collection collection = null;
Object[] object = null;
Iterator iterator = null;
sqlStr = "SELECT subject
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
【项目源码】-java学生管理系统 package appstu; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.PrintStream; import java.util.Scanner; import appstu.util.CommonaJdbc; import appstu.view.JF_login; public class AppStu { boolean packFrame = false; public static void main(String[] args) { try { new Thread() {
资源推荐
资源详情
资源评论
收起资源包目录
项目源码-java学生管理系统 (166个子文件)
JF_view_gradesub.class 13KB
JF_view_student.class 13KB
JF_view_teacher.class 10KB
JdbcAdapter.class 10KB
JF_view_sysset_class.class 10KB
JF_view_query_jbqk.class 8KB
JF_view_user_modify.class 8KB
JF_login.class 8KB
JF_view_query_grade_hz.class 8KB
JF_view_sysset_grade.class 8KB
JF_view_sysset_examkinds.class 8KB
JF_view_sysset_subject.class 8KB
JF_view_sysset.class 7KB
JF_view_query_grade_mx.class 7KB
AppMain.class 7KB
MenuBarEvent.class 5KB
JF_view_error.class 4KB
RetrieveObject.class 3KB
ProduceLsh.class 3KB
AppStu$1.class 2KB
ProduceMaxBh.class 2KB
Obj_student.class 2KB
Obj_gradeinfo_sub.class 2KB
Obj_teacher.class 1KB
CommonaJdbc.class 1KB
SendFocuseAdapter.class 1KB
Obj_classinfo.class 937B
Obj_user.class 907B
AppMain$4.class 887B
AppMain$2.class 887B
AppMain$3.class 887B
AppMain$1.class 887B
JF_view_sysset_examkinds_jButton3_actionAdapter.class 783B
JF_view_sysset_examkinds_jBexit_actionAdapter.class 779B
JF_view_sysset_examkinds_jBdel_actionAdapter.class 776B
JF_view_sysset_examkinds_jBadd_actionAdapter.class 776B
JF_view_sysset_subject_jButton3_actionAdapter.class 771B
JF_view_sysset_subject_jBexit_actionAdapter.class 767B
JF_view_query_grade_mx_jBexit_actionAdapter.class 767B
JF_view_query_grade_hz_jBexit_actionAdapter.class 767B
JF_view_sysset_subject_jBadd_actionAdapter.class 764B
JF_view_query_grade_hz_jByes_actionAdapter.class 764B
JF_view_sysset_subject_jBdel_actionAdapter.class 764B
JF_view_query_grade_mx_jByes_actionAdapter.class 764B
JF_view_sysset_class_jButton3_actionAdapter.class 759B
JF_view_sysset_class_jComboBox1_itemAdapter.class 759B
JF_view_sysset_grade_jButton3_actionAdapter.class 759B
JF_view_query_jbqk_jComboBox2_itemAdapter.class 755B
JF_view_query_jbqk_jComboBox3_itemAdapter.class 755B
JF_view_sysset_class_jBexit_actionAdapter.class 755B
JF_view_sysset_grade_jBexit_actionAdapter.class 755B
JF_view_query_jbqk_jComboBox1_itemAdapter.class 755B
JF_view_query_jbqk_jBexit_actionAdapter.class 753B
JF_view_user_modify_jButton3_actionAdapter.class 753B
JF_view_sysset_grade_jBdel_actionAdapter.class 752B
JF_view_sysset_class_jBdel_actionAdapter.class 752B
JF_view_sysset_grade_jBadd_actionAdapter.class 752B
JF_view_sysset_class_jBadd_actionAdapter.class 752B
JF_view_query_jbqk_jByes_actionAdapter.class 750B
JF_view_user_modify_jBexit_actionAdapter.class 749B
JF_view_user_modify_jBadd_actionAdapter.class 746B
JF_view_user_modify_jBdel_actionAdapter.class 746B
JF_view_sysset_examkinds_jTable1_mouseAdapter.class 746B
Obj_gradeinfo.class 746B
Obj_examkinds.class 740B
JF_view_gradesub_jComboBox2_itemAdapter.class 735B
JF_view_teacher_jBrefresh_actionAdapter.class 734B
JF_view_sysset_subject_jTable1_mouseAdapter.class 734B
JF_view_student_jBrefresh_actionAdapter.class 734B
JF_view_gradesub_jBexit_actionAdapter.class 731B
JF_view_gradesub_jBsave_actionAdapter.class 731B
JF_view_student_jComboBox2_itemAdapter.class 729B
JF_view_student_jComboBox1_itemAdapter.class 729B
JF_view_gradesub_jBadd_actionAdapter.class 728B
JF_view_gradesub_jBdel_actionAdapter.class 728B
JF_view_student_jBsave_actionAdapter.class 725B
JF_view_student_jBexit_actionAdapter.class 725B
JF_view_teacher_jBsave_actionAdapter.class 725B
JF_view_teacher_jBexit_actionAdapter.class 725B
Obj_subject.class 725B
JF_view_sysset_jButton3_actionAdapter.class 723B
JF_view_sysset_class_jTable1_mouseAdapter.class 722B
JF_view_student_jBdel_actionAdapter.class 722B
JF_view_student_jBadd_actionAdapter.class 722B
JF_view_sysset_grade_jTable1_mouseAdapter.class 722B
JF_view_teacher_jBdel_actionAdapter.class 722B
JF_view_teacher_jBadd_actionAdapter.class 722B
JF_view_error_jButton1_actionAdapter.class 719B
JF_view_error_jButton2_actionAdapter.class 719B
JF_view_sysset_jBexit_actionAdapter.class 719B
JF_view_sysset_jBdel_actionAdapter.class 716B
JF_view_sysset_jBadd_actionAdapter.class 716B
JF_view_user_modify_jTable1_mouseAdapter.class 716B
JF_view_query_jbqk_jTextField1_keyAdapter.class 715B
JF_view_user_modify_jTextField1_keyAdapter.class 714B
JF_view_gradesub_jTable1_mouseAdapter.class 698B
JF_view_student_jTable1_mouseAdapter.class 692B
JF_view_teacher_jTable1_mouseAdapter.class 692B
JF_view_sysset_jTable1_mouseAdapter.class 686B
JF_login_jBlogin_actionAdapter.class 686B
共 166 条
- 1
- 2
资源评论
西攻城狮北
- 粉丝: 6872
- 资源: 434
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功