⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 framechangeoradd.java~31~

📁 学生成绩管理系统
💻 JAVA~31~
📖 第 1 页 / 共 2 页
字号:
package teamwork;

import java.awt.*;

import javax.swing.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

/**
 * <p>Title: teamwork</p>
 *
 * <p>Description: </p>
 *
 * <p>Copyright: Copyright (c) 2007</p>
 *
 * <p>Company: </p>
 *
 * @author yeliang
 * @version 1.0
 */
public class Framechangeoradd extends JFrame {
    public Framechangeoradd() {
        try {
            setDefaultCloseOperation(EXIT_ON_CLOSE);
            jbInit();
        } catch (Exception exception) {
            exception.printStackTrace();
        }
    }

    private void jbInit() throws Exception {
        getContentPane().setLayout(null);
        this.getContentPane().setBackground(new Color(100, 180, 255));
        jButton_back3.setBackground(new Color(100, 180, 255));
        jButton_back3.setBounds(new Rectangle(8, 420, 480, 40));
        jButton_back3.setFont(new java.awt.Font("宋体", Font.BOLD, 15));
        jButton_back3.setForeground(Color.orange);
        jButton_back3.setText("返 回 上 一 级");
        jButton_back3.addActionListener(new
                Framechangeoradd_jButton_back3_actionAdapter(this));
        jComboBox1.addActionListener(new
                                     Framechangeoradd_jComboBox1_actionAdapter(this));
        jButton_add.setBounds(new Rectangle(379, 68, 71, 25));
        jButton_add.setFont(new java.awt.Font("宋体", Font.PLAIN, 13));
        jButton_add.setText("添加");
        jButton_add.addActionListener(new
                Framechangeoradd_jButton_add_actionAdapter(this));
        //jButton_add.setVisible(false);
        jButton_ok2.addActionListener(new
                Framechangeoradd_jButton_ok2_actionAdapter(this));
        jLabel5.setFont(new java.awt.Font("宋体", Font.PLAIN, 13));
        jLabel5.setText("jLabel5");
        jLabel5.setBounds(new Rectangle(27, 124, 425, 16));
        jLabel5.setVisible(false);
        Lname.setFont(new java.awt.Font("宋体", Font.PLAIN, 13));
        Lname.setText("姓名:");
        Lname.setBounds(new Rectangle(30, 45, 46, 20));
        Lsex.setFont(new java.awt.Font("宋体", Font.PLAIN, 13));
        Lsex.setText("性别:");
        Lsex.setBounds(new Rectangle(29, 68, 46, 16));
        LclassNo.setFont(new java.awt.Font("宋体", Font.PLAIN, 13));
        LclassNo.setText("班级:");
        LclassNo.setBounds(new Rectangle(29, 96, 42, 16));
        Lid.setFont(new java.awt.Font("宋体", Font.PLAIN, 13));
        Lid.setText("学号:");
        Lid.setBounds(new Rectangle(29, 123, 43, 16));
        jTextname.setText("");
        jTextname.setBounds(new Rectangle(80, 43, 107, 21));
        jTextclassNo.setText("");
        jTextclassNo.setBounds(new Rectangle(81, 94, 106, 21));
        jTextid.setText("");
        jTextid.setBounds(new Rectangle(81, 121, 106, 21));
        jButton_addok.setBounds(new Rectangle(244, 118, 161, 25));
        jButton_addok.setFont(new java.awt.Font("宋体", Font.PLAIN, 13));
        jButton_addok.setText("确定添加并录入成绩");
        jButton_addok.addActionListener(new
                Framechangeoradd_jButton_addok_actionAdapter(this));
        jTextArea1.setBackground(new Color(100, 180, 255));
        jTextArea1.setEnabled(false);
        jTextArea1.setFont(new java.awt.Font("宋体", Font.PLAIN, 16));
        jTextArea1.setDisabledTextColor(Color.black);
        jTextArea1.setText("学号重复或填写错误或不完整,请重新填写");
        jTextArea1.setVisible(false);
        jTextArea1.setLineWrap(true);
        jTextArea1.setBounds(new Rectangle(243, 38, 162, 63));
        jComboBox2.setBounds(new Rectangle(80, 65, 104, 20));
        jComboBox2.addItem("男");
        jComboBox2.addItem("女");
        jComboBox2.setVisible(false);
        Lwritemark.setFont(new java.awt.Font("宋体", Font.PLAIN, 14));
        Lwritemark.setText("录入成绩:");
        Lwritemark.setBounds(new Rectangle(38, 175, 93, 16));
        Lwritemark.setVisible(false);
        jCombotearm.setBounds(new Rectangle(39, 228, 104, 21));
        jCombotearm.addItem("第一学期课程");
        jCombotearm.addItem("第二学期课程");
        jCombotearm.addItem("第三学期课程");
        jCombotearm.addItem("第四学期课程");
        jCombotearm.setVisible(false);
        Ltearm.setFont(new java.awt.Font("宋体", Font.PLAIN, 13));
        Ltearm.setText("学期");
        Ltearm.setBounds(new Rectangle(68, 204, 41, 16));
        Ltearm.setVisible(false);
        Lcourse.setFont(new java.awt.Font("宋体", Font.PLAIN, 13));
        Lcourse.setText("课程名称");
        Lcourse.setBounds(new Rectangle(197, 204, 69, 16));
        Lcourse.setVisible(false);
        Lmark.setFont(new java.awt.Font("宋体", Font.PLAIN, 13));
        Lmark.setText("分数");
        Lmark.setBounds(new Rectangle(335, 204, 34, 14));
        Lmark.setVisible(false);
        jTextcourse.setText("");
        jTextcourse.setBounds(new Rectangle(166, 228, 131, 21));
        jTextcourse.setVisible(false);
        jTextmark.setText("");
        jTextmark.setBounds(new Rectangle(320, 228, 62, 21));
        jTextmark.setVisible(false);
        jButton_markin.setBounds(new Rectangle(360, 282, 71, 25));
        jButton_markin.setFont(new java.awt.Font("宋体", Font.PLAIN, 13));
        jButton_markin.setText("录入");
        jButton_markin.addActionListener(new
                Framechangeoradd_jButton_markin_actionAdapter(this));
        Lcontinue.setFont(new java.awt.Font("宋体", Font.PLAIN, 15));
        Lcontinue.setText("已录入成绩,继续请重新输入,点击录入按钮");
        Lcontinue.setBounds(new Rectangle(33, 285, 313, 16));
        Lcontinue.setVisible(false);
        jButton_writefinish.setBounds(new Rectangle(273, 323, 158, 29));
        jButton_writefinish.setFont(new java.awt.Font("宋体", Font.PLAIN, 13));
        jButton_writefinish.setText("录入完毕返回主窗口");
        jButton_writefinish.setVisible(false);
        jButton_writefinish.addActionListener(new
                Framechangeoradd_jButton_writefinish_actionAdapter(this));
        jButton_markin.setVisible(false);
        Lnew_inf.setFont(new java.awt.Font("宋体", Font.PLAIN, 13));
        Lnew_inf.setText("请输入新信息:");
        Lnew_inf.setBounds(new Rectangle(27, 141, 109, 16));
        Lname_c.setFont(new java.awt.Font("宋体", Font.PLAIN, 13));
        //Lname_c.setVisible(false);
        Lname_c.setText("姓名:");
        Lname_c.setBounds(new Rectangle(26, 163, 46, 20));
        Lsex_c.setFont(new java.awt.Font("宋体", Font.PLAIN, 13));
        Lsex_c.setText("性别:");
        Lsex_c.setBounds(new Rectangle(26, 190, 46, 20));
        Lid_c.setFont(new java.awt.Font("宋体", Font.PLAIN, 13));
        Lid_c.setText("学号:");
        Lid_c.setBounds(new Rectangle(27, 246, 46, 20));
        LcalssNo_c.setFont(new java.awt.Font("宋体", Font.PLAIN, 13));
        LcalssNo_c.setText("班级:");
        LcalssNo_c.setBounds(new Rectangle(27, 220, 46, 20));
        jTextname_c.setText("");
        jTextname_c.setBounds(new Rectangle(73, 165, 104, 21));
        jTextclassNo_c.setText("");
        jTextclassNo_c.setBounds(new Rectangle(74, 220, 105, 21));
        jTextid_c.setText("");
        jTextid_c.setBounds(new Rectangle(74, 247, 104, 21));
        //jComboBox3.setVisible(false);
        jComboBox3.setBounds(new Rectangle(73, 193, 104, 20));
        jComboBox3.addItem("男");
        jComboBox3.addItem("女");
        jButton_changeok.setBounds(new Rectangle(233, 247, 152, 25));
        jButton_changeok.setFont(new java.awt.Font("宋体", Font.PLAIN, 13));
        jButton_changeok.setText("确认修改");
        jButton_changeok.addActionListener(new
                Framechangeoradd_jButton_changeok_actionAdapter(this));
        jButton_del.setBounds(new Rectangle(27, 283, 152, 25));
        jButton_del.setFont(new java.awt.Font("宋体", Font.PLAIN, 13));
        jButton_del.setText("删除该学生及其信息");
        jButton_del.addActionListener(new
                Framechangeoradd_jButton_del_actionAdapter(this));
        jText_error2.setBackground(new Color(100, 180, 255));
        jText_error2.setEnabled(false);
        jText_error2.setFont(new java.awt.Font("宋体", Font.PLAIN, 16));
        //jText_error2.setVisible(false);
        jText_error2.setDisabledTextColor(Color.black);
        jText_error2.setText("学号重复或填写错误或不完整,请重新填写");
        jText_error2.setLineWrap(true);
        jText_error2.setBounds(new Rectangle(228, 178, 162, 63));
        this.getContentPane().add(jButton_back3);
        jLabel4.setFont(new java.awt.Font("宋体", Font.PLAIN, 12));
        jLabel4.setVisible(false);
        jLabel4.setText("学生基本信息:");
        jLabel4.setBounds(new Rectangle(28, 96, 94, 16));
        jLabel3.setFont(new java.awt.Font("宋体", Font.PLAIN, 13));
        jLabel3.setVisible(false);
        jLabel3.setText("没找到,请重新输入");
        jLabel3.setBounds(new Rectangle(28, 72, 162, 16));
        jTextField1.setBounds(new Rectangle(231, 40, 134, 21));
        jButton_ok2.setBounds(new Rectangle(379, 38, 71, 25));
        jButton_ok2.setFont(new java.awt.Font("宋体", Font.PLAIN, 13));
        jButton_ok2.setText("确定");
        jComboBox1.setBounds(new Rectangle(28, 41, 110, 20));
        jComboBox1.addItem("按姓名查找");
        jComboBox1.addItem("按学号查找");
        jLabel2.setFont(new java.awt.Font("宋体", Font.PLAIN, 13));
        jLabel2.setText("请选择查询方式查找要修改信息的学生:(添加直接点确定)");
        jLabel2.setBounds(new Rectangle(29, 21, 362, 16));
        Lname.setVisible(false);
        LclassNo.setVisible(false);
        Lid.setVisible(false);
        Lsex.setVisible(false);
        jTextname.setVisible(false);
        jTextclassNo.setVisible(false);
        jTextid.setVisible(false);
        jButton_addok.setVisible(false);
        Lnew_inf.setVisible(false);
        Lname_c.setVisible(false);
        Lsex_c.setVisible(false);
        LcalssNo_c.setVisible(false);
        Lid_c.setVisible(false);
        jTextname_c.setVisible(false);
        jTextid_c.setVisible(false);
        jComboBox3.setVisible(false);
        jTextclassNo_c.setVisible(false);
        jButton_changeok.setVisible(false);
        jButton_del.setVisible(false);
        jText_error2.setVisible(false);

        this.getContentPane().add(jLabel1);
        this.getContentPane().add(jLabel2);
        this.getContentPane().add(jComboBox1);
        this.getContentPane().add(jButton_ok2);
        this.getContentPane().add(jTextField1);
        this.getContentPane().add(jLabel3);
        this.getContentPane().add(jLabel4);
        this.getContentPane().add(jLabel5);
        this.getContentPane().add(Lname);
        this.getContentPane().add(Lsex);
        this.getContentPane().add(jTextname);
        this.getContentPane().add(Lid);
        this.getContentPane().add(LclassNo);
        this.getContentPane().add(jTextclassNo);
        this.getContentPane().add(jTextid);
        this.getContentPane().add(jButton_addok);
        this.getContentPane().add(jTextArea1);
        this.getContentPane().add(jComboBox2);
        this.getContentPane().add(Lwritemark);
        this.getContentPane().add(Ltearm);
        this.getContentPane().add(Lcourse);
        this.getContentPane().add(jTextcourse);
        this.getContentPane().add(jCombotearm);
        this.getContentPane().add(jTextmark);
        this.getContentPane().add(Lmark);
        this.getContentPane().add(jButton_markin);
        this.getContentPane().add(Lcontinue);
        this.getContentPane().add(jButton_writefinish);
        this.getContentPane().add(Lnew_inf);
        this.getContentPane().add(Lname_c);
        this.getContentPane().add(Lsex_c);
        this.getContentPane().add(LcalssNo_c);
        this.getContentPane().add(Lid_c);
        this.getContentPane().add(jTextname_c);
        this.getContentPane().add(jComboBox3);
        this.getContentPane().add(jTextid_c);
        this.getContentPane().add(jTextclassNo_c);
        this.getContentPane().add(jButton_changeok);
        this.getContentPane().add(jButton_del);
        this.getContentPane().add(jText_error2);
        this.getContentPane().add(jButton_add);
        jLabel1.setFont(new java.awt.Font("宋体", Font.PLAIN, 13));
        jLabel1.setText("请输入姓名:");
        jLabel1.setBounds(new Rectangle(144, 44, 80, 16));
        s.readdata();
    }

    public static void main(String[] args) {
        Framechangeoradd framechangeoradd = new Framechangeoradd();
    }
    studentDA s = new studentDA();
    student one = new student();//欲添加的新学生
    int n=0;//被查找到的学生
    //s.readdata();
    JButton jButton_back3 = new JButton();
    JLabel jLabel1 = new JLabel();
    JLabel jLabel2 = new JLabel();
    JComboBox jComboBox1 = new JComboBox();
    JButton jButton_ok2 = new JButton();
    JTextField jTextField1 = new JTextField();
    JLabel jLabel3 = new JLabel();
    JLabel jLabel4 = new JLabel();
    JButton jButton_add = new JButton();
    JLabel jLabel5 = new JLabel();
    JLabel Lname = new JLabel();
    JLabel Lsex = new JLabel();
    JLabel LclassNo = new JLabel();
    JLabel Lid = new JLabel();
    JTextField jTextname = new JTextField();
    JTextField jTextclassNo = new JTextField();
    JTextField jTextid = new JTextField();
    JButton jButton_addok = new JButton();
    JTextArea jTextArea1 = new JTextArea();
    JComboBox jComboBox2 = new JComboBox();
    JLabel Lwritemark = new JLabel();
    JComboBox jCombotearm = new JComboBox();
    JLabel Ltearm = new JLabel();
    JLabel Lcourse = new JLabel();
    JLabel Lmark = new JLabel();
    JTextField jTextcourse = new JTextField();
    JTextField jTextmark = new JTextField();
    JButton jButton_markin = new JButton();
    JLabel Lcontinue = new JLabel();
    JButton jButton_writefinish = new JButton();
    JLabel Lnew_inf = new JLabel();
    JLabel Lname_c = new JLabel();
    JLabel Lsex_c = new JLabel();
    JLabel Lid_c = new JLabel();
    JLabel LcalssNo_c = new JLabel();
    JTextField jTextname_c = new JTextField();
    JTextField jTextclassNo_c = new JTextField();
    JTextField jTextid_c = new JTextField();
    JComboBox jComboBox3 = new JComboBox();
    JButton jButton_changeok = new JButton();
    JButton jButton_del = new JButton();
    JTextArea jText_error2 = new JTextArea();
    public void jButton_back3_actionPerformed(ActionEvent e) {
        this.dispose();
        Frame_manage f = new Frame_manage();
        f.setSize(380,300);
        f.setVisible(true);

    }

    public void jComboBox1_actionPerformed(ActionEvent e) {
        if(jComboBox1.getSelectedIndex() == 0)
            jLabel1.setText("请输入姓名:");
        else if(jComboBox1.getSelectedIndex() == 1)
            jLabel1.setText("请输入学号:");

    }

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -