Java编的学生管理系统

  • N8_679986
    了解作者
  • 1.2MB
    文件大小
  • zip
    文件格式
  • 0
    收藏次数
  • VIP专享
    资源类型
  • 0
    下载次数
  • 2022-06-15 06:37
    上传日期
这是一个Java学生管理系统的代码,仅供学习参考
学生管理系统.zip
内容介绍
package com.sise.sims.gui; import java.awt.Dimension; import java.awt.GridBagConstraints; import java.awt.GridBagLayout; import java.awt.Image; import java.awt.Insets; import java.awt.Toolkit; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.JButton; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JOptionPane; import javax.swing.JPanel; import javax.swing.JTextField; import com.sise.sims.database.ClassBean; import com.sise.sims.database.StudentMsgBean; /** *项目名称:sims *类名:StudentMsgGui *类描述: *创建人:马增群 *创建时间:2014年11月23日 上午7:49:13 *修改人: *修改时间: *修改备注: *@version 1.0.0 */ public class StudentMsgGui extends JFrame{ ClassBean cBean=new ClassBean(); StudentMsgBean sMBean=new StudentMsgBean(); JOptionPane op=new JOptionPane(); private JPanel p1=null; private JPanel p2=null; private JPanel p3=null; private JLabel numLabel=null; private JLabel nameLabel=null; private JLabel ageLabel=null; private JLabel sexLabel=null; private JLabel classLabel=null;//班级 private JLabel idCardLabel=null;//身份证 private JLabel natLabel=null;//民族 private JLabel telLabel=null; private JLabel eDateLabel=null;//入学时间 private JLabel addrLabel=null; private static JTextField numTextField=null; private static JTextField nameTextField=null; private static JTextField ageTextField=null; private static JTextField sexTextField=null; private static JTextField classTextField=null; private static JTextField idCardTextField=null; private static JTextField natTextField=null; private static JTextField telTextField=null; private static JTextField eDateTextField=null; private static JTextField addrTextField=null; private JButton updateBtn=null; private JButton returnBtn=null; /* * GridBagLayout布局 */ private GridBagLayout gridL=null; private GridBagConstraints gridC=null; int width=5; public static String s[]=new String[10]; //ShowAllStuMsgGui stuMsg=null; public StudentMsgGui(){ setTitle("学生信息详细界面"); Image image = Toolkit.getDefaultToolkit().getImage("../sims/images/sing.png"); setIconImage(image); topPanel();//上部面板 centerPanel();//中部面板 bottomPanel(); //下部面板 add("North",p1); add("Center",p2); add("South",p3); setMsg(); //setLocation(300,300); //设置运行时窗口的位置 Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); Dimension frameSize = getSize(); if (frameSize.height > screenSize.height) { frameSize.height = screenSize.height; } if (frameSize.width > screenSize.width) { frameSize.width = screenSize.width; } setLocation((screenSize.width - frameSize.width) / 3, (screenSize.height - frameSize.height) / 3); resize(330,350); setResizable(false); setVisible(true); } /** *方法说明:上部面板的布局,包括学号,姓名,年龄的相关组件 * */ public void topPanel(){ p1=new JPanel(); gridL=new GridBagLayout(); p1.setLayout(gridL); //学号 numLabel=new JLabel("学生编号:"); gridC=new GridBagConstraints(); gridC.gridx=0; gridC.gridy=0; gridC.insets=new Insets(5, 5, 10, 10); gridL.addLayoutComponent(numLabel, gridC); p1.add(numLabel); //姓名 nameLabel=new JLabel("学生姓名:"); gridC=new GridBagConstraints(); gridC.gridx=1; gridC.gridy=0; gridC.insets=new Insets(5, 5, 10, 10); gridL.addLayoutComponent(nameLabel, gridC); p1.add(nameLabel); //年龄 ageLabel=new JLabel("年龄:"); gridC=new GridBagConstraints(); gridC.gridx=2; gridC.gridy=0; gridC.insets=new Insets(5, 5, 10, 10); gridL.addLayoutComponent(ageLabel, gridC); p1.add(ageLabel); //学号 numTextField=new JTextField(width); numTextField.setText(s[0]);//跨类传来的值 gridC=new GridBagConstraints(); gridC.gridx=0; gridC.gridy=1; gridC.insets=new Insets(5, 5, 10, 10); gridL.addLayoutComponent(numTextField, gridC); p1.add(numTextField); //姓名 nameTextField=new JTextField(width); nameTextField.setText(s[1]); gridC=new GridBagConstraints(); gridC.gridx=1; gridC.gridy=1; gridC.insets=new Insets(5, 5, 10, 10); gridL.addLayoutComponent(nameTextField, gridC); p1.add(nameTextField); //年龄 ageTextField=new JTextField(width); ageTextField.setText(s[2]); gridC=new GridBagConstraints(); gridC.gridx=2; gridC.gridy=1; gridC.insets=new Insets(5, 5, 10, 10); gridL.addLayoutComponent(ageTextField, gridC); p1.add(ageTextField); } /** *方法说明:中部面板的布局,包括性别,班级,身份证,民族,联系,身份证的相关组件 * */ public void centerPanel(){ p2=new JPanel(); gridL=new GridBagLayout(); p2.setLayout(gridL); //性别 sexLabel=new JLabel("性别:"); gridC=new GridBagConstraints(); gridC.gridx=0; gridC.gridy=2; gridC.insets=new Insets(5, 5, 10, 10); gridL.addLayoutComponent(sexLabel, gridC); p2.add(sexLabel); //班级 classLabel=new JLabel("所在班级:"); gridC=new GridBagConstraints(); gridC.gridx=1; gridC.gridy=2; gridC.insets=new Insets(5, 5, 10, 10); gridL.addLayoutComponent(classLabel, gridC); p2.add(classLabel); //身份证 idCardLabel=new JLabel("身份证:"); gridC=new GridBagConstraints(); gridC.gridx=2; gridC.gridy=2; gridC.insets=new Insets(5, 5, 10, 10); gridL.addLayoutComponent(idCardLabel, gridC); p2.add(idCardLabel); //性别 sexTextField=new JTextField(width); sexTextField.setText(s[3]); gridC=new GridBagConstraints(); gridC.gridx=0; gridC.gridy=3; gridC.insets=new Insets(5, 5, 10, 10); gridL.addLayoutComponent(sexTextField, gridC); p2.add(sexTextField); //班级 classTextField=new JTextField(width); classTextField.setText(s[4]); gridC=new GridBagConstraints(); gridC.gridx=1; gridC.gridy=3; gridC.insets=new Insets(5, 5, 10, 10); gridL.addLayoutComponent(classTextField, gridC); p2.add(classTextField); //身份证 idCardTextField=new JTextField(width); idCardTextField.setText(s[5]); gridC=new GridBagConstraints(); gridC.gridx=2; gridC.gridy=3; gridC.insets=new Insets(5, 5, 10, 10); gridL.addLayoutComponent(idCardTextField, gridC); p2.add(idCardTextField); //民族 natLabel=new JLabel("民族:"); gridC=new GridBagConstraints(); gridC.gridx=0; gridC.gridy=4; gridC.insets=new Insets(5, 5, 10, 10); gridL.addLayoutComponent(natLabel, gridC); p2.add(natLabel); //联系 telLabel=new JLabel("联系方式:"); gridC=new GridBagConstraints(); gridC.gridx=1; gridC.gridy=4; gridC.insets=new Insets(5, 5, 10, 10); gridL.addLayoutComponent(telLabel, gridC); p2.add(telLabel); //入学时间 eDateLabel=new JLabel("入学日期:"); gridC=new GridBagConstraints(); gridC.gridx=2; gridC.gridy=4; gridC.insets=new Insets(5, 5, 10, 10); gridL.addLayoutComponent(eDateLabel, gridC); p2.add(eDateLabel); //民族 natTextField=new JTextField(width); natTextField.setText(s[6]); gridC=new GridBagConstraints(); gridC.gridx=0; gridC.gridy=5; gridC.insets=new Insets(5, 5, 10, 10); gridL.addLayoutComponent(natTextField, gridC); p2.add(natTextField); //联系 telTextField=new JTextField(width); telTextField.setText(s[7]); gridC=new GridBagConstraints(); gridC.gridx=1; gridC.gridy=5; gridC.insets=new Insets(5, 5, 10, 10); gridL.addLayoutComponent(telTextField, gridC); p2.add(telTextField); //入学时间 eDateTextField=new JTextField(width); eDateTextField.setText(s[8]); gridC=new GridBagConstraints(); gridC.gridx=2; gridC.gridy=5; gridC.insets=new Insets(5, 5, 10, 10); gridL.addLayoutComponent(eDateTextField, gridC); p2.add(eDateTextField); } /** *方法说明:下部面板的布局,包括地址相关组件 *修改,取消按钮 * */ public void bottomPanel(){
评论
    相关推荐
    • Java
      Java
    • java
      Java
    • Java
      Java
    • Java
      Java项目
    • Java
      Java 对于Java练习
    • java
      Java 此回购包括我学习Java的旅程。
    • java
      Java Java基础
    • Java
      Java
    • Java
      Java 我创建的Java项目
    • Java
      Java 2021/02/19 .java Main.java 学生.java Bmi.java 。班级 Bmi类 主类 MyBmi.class 学生班 学生样本类 2021/02/20 .java DeleteFile.java WriteFile.java MyDataPrint.java 。班级 DeleteFile.class ...