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

📄 exammanageframe.java~82~

📁 考试管理系统:实现学生信息的注册、修改、查询、删除;以及对试题进行管理:增加试题、修改试题、删除试题、查询试题
💻 JAVA~82~
📖 第 1 页 / 共 2 页
字号:
/**
 * 试题管理界面
 */
package edu.sccp.examManager.client;

import java.awt.*;
import javax.swing.*;
import javax.swing.border.TitledBorder;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import edu.sccp.examManager.business.TestBO;
import edu.sccp.examManager.VO.TestVO;
import edu.sccp.examManager.tools.Tools;
import edu.sccp.examManager.business.TestTypeBO;

public class ExamManageFrame extends JFrame {
    public ExamManageFrame() {
        try {
            jbInit();
        } catch (Exception exception) {
            exception.printStackTrace();
        }
    }

    public void setTestId(String s){
        testId.setText(s);
    }

    /**
     * “添加”按钮 使能/停用
     * @param bl boolean
     */
    public void setAddButton(boolean bl){
        addButton.setEnabled(bl);
    }
    /**
     * “修改”按钮 使能/停用
     * @param bl boolean
     */
    public void setEditButton(boolean bl){
        editButton.setEnabled(bl);
    }

    /**
     * 界面初始化
     * @throws Exception
     */
    private void jbInit() throws Exception {
        getContentPane().setLayout(null);
        this.setSize(new Dimension(532, 555));
        this.setTitle("试题添加/修改");
        jLabel1.setFont(new java.awt.Font("Dialog", Font.PLAIN, 14));
        jLabel1.setText("试题编号");
        jLabel1.setBounds(new Rectangle(48, 40, 67, 24));
        testId.setFont(new java.awt.Font("Dialog", Font.PLAIN, 14));
        testId.setEditable(false);
        editButton.setBounds(new Rectangle(192, 20, 79, 27));
        editButton.setEnabled(false);
        editButton.setFont(new java.awt.Font("Dialog", Font.PLAIN, 14));
        editButton.setText("修改");
        editButton.addActionListener(new
                ExamManageFrame_confirmButton_actionAdapter(this));
        jPanel1.setLayout(null);
        cancelButton.setBounds(new Rectangle(306, 18, 79, 27));
        cancelButton.setFont(new java.awt.Font("Dialog", Font.PLAIN, 14));
        cancelButton.setText("取消");
        cancelButton.addActionListener(new
                ExamManageFrame_cancelButton_actionAdapter(this));
        answerB.setFont(new java.awt.Font("Dialog", Font.PLAIN, 14));
        answerB.setText("B");
        answerB.setBounds(new Rectangle(356, 392, 35, 29));
        answerD.setBounds(new Rectangle(450, 394, 39, 27));
        testType.addActionListener(new ExamManageFrame_examType_actionAdapter(this));
        answerC.setFont(new java.awt.Font("Dialog", Font.PLAIN, 14));
        answerC.setText("C");
        answerC.setBounds(new Rectangle(399, 393, 39, 27));
        difficulty.setFont(new java.awt.Font("Dialog", Font.PLAIN, 14));
        difficulty.setForeground(Color.black);
        difficulty.setBorder(BorderFactory.createEtchedBorder());
        difficulty.setRequestFocusEnabled(false);
        difficulty.setToolTipText("");
        difficulty.addItem("简单");
        difficulty.addItem("中等");
        difficulty.addItem("困难");
        testContent.setBorder(BorderFactory.createLoweredBevelBorder());
        testType.setFont(new java.awt.Font("Dialog", Font.PLAIN, 14));
        testSubClass.setFont(new java.awt.Font("Dialog", Font.PLAIN, 14));
        jScrollPane1.setBounds(new Rectangle(110, 118, 376, 109));
        testName.setFont(new java.awt.Font("Dialog", Font.PLAIN, 14));
        itemA.setFont(new java.awt.Font("Dialog", Font.PLAIN, 14));
        itemB.setFont(new java.awt.Font("Dialog", Font.PLAIN, 14));
        itemC.setFont(new java.awt.Font("Dialog", Font.PLAIN, 14));
        itemD.setFont(new java.awt.Font("Dialog", Font.PLAIN, 14));
        addButton.setBounds(new Rectangle(70, 19, 71, 26));
        addButton.setEnabled(false);
        addButton.setFont(new java.awt.Font("Dialog", Font.PLAIN, 14));
        addButton.setText("添加");
        addButton.addActionListener(new ExamManageFrame_addButton_actionAdapter(this));
        this.getContentPane().add(jLabel1);
        jPanel1.setBorder(BorderFactory.createEtchedBorder());
        jPanel1.setBounds(new Rectangle(45, 441, 456, 71));
        answerD.setFont(new java.awt.Font("Dialog", Font.PLAIN, 14));
        answerD.setText("D");
        answerA.setFont(new java.awt.Font("Dialog", Font.PLAIN, 14));
        answerA.setText("A");
        answerA.setBounds(new Rectangle(308, 392, 39, 27));
        jLabel12.setFont(new java.awt.Font("Dialog", Font.PLAIN, 14));
        jLabel12.setText("正确答案");
        jLabel12.setBounds(new Rectangle(242, 392, 60, 23));
        difficulty.setBounds(new Rectangle(114, 388, 110, 27));
        jLabel11.setFont(new java.awt.Font("Dialog", Font.PLAIN, 14));
        jLabel11.setText("试题难度:");
        jLabel11.setBounds(new Rectangle(38, 392, 73, 22));
        itemD.setBounds(new Rectangle(136, 352, 358, 23));
        jLabel10.setFont(new java.awt.Font("Dialog", Font.PLAIN, 14));
        jLabel10.setText("D");
        jLabel10.setBounds(new Rectangle(109, 357, 17, 15));
        itemC.setBounds(new Rectangle(136, 316, 358, 23));
        jLabel9.setFont(new java.awt.Font("Dialog", Font.PLAIN, 14));
        jLabel9.setText("C");
        jLabel9.setBounds(new Rectangle(109, 318, 22, 19));
        itemB.setBounds(new Rectangle(136, 282, 358, 23));
        jLabel8.setFont(new java.awt.Font("Dialog", Font.PLAIN, 14));
        jLabel8.setToolTipText("");
        jLabel8.setText("B");
        jLabel8.setBounds(new Rectangle(109, 289, 15, 18));
        itemA.setBounds(new Rectangle(136, 241, 358, 23));
        jLabel7.setFont(new java.awt.Font("Dialog", Font.PLAIN, 14));
        jLabel7.setText("A");
        jLabel7.setBounds(new Rectangle(109, 249, 14, 19));
        jLabel6.setFont(new java.awt.Font("Dialog", Font.PLAIN, 14));
        jLabel6.setText("选项");
        jLabel6.setBounds(new Rectangle(49, 241, 45, 22));
        jLabel5.setFont(new java.awt.Font("Dialog", Font.PLAIN, 14));
        jLabel5.setText("题干");
        jLabel5.setBounds(new Rectangle(47, 144, 55, 17));
        testSubClass.setBounds(new Rectangle(339, 81, 148, 26));
        jLabel4.setFont(new java.awt.Font("Dialog", Font.PLAIN, 14));
        jLabel4.setText("子类");
        jLabel4.setBounds(new Rectangle(266, 80, 64, 21));
        testType.setBounds(new Rectangle(112, 83, 133, 26));
        testType.addItem("Java");
        testType.addItem("数据库");
        testType.addItem(".net");
        //examType.addItem("C++");
        jLabel3.setFont(new java.awt.Font("Dialog", Font.PLAIN, 14));
        jLabel3.setText("试题类别");
        jLabel3.setBounds(new Rectangle(47, 82, 60, 23));
        testName.setBounds(new Rectangle(337, 38, 149, 22));
        jLabel2.setFont(new java.awt.Font("Dialog", Font.PLAIN, 14));
        jLabel2.setText("试题名称");
        jLabel2.setBounds(new Rectangle(261, 37, 60, 23));
        this.getContentPane().add(testId);
        this.getContentPane().add(jLabel2);
        this.getContentPane().add(testName);
        this.getContentPane().add(testType);
        this.getContentPane().add(jLabel3);
        this.getContentPane().add(jLabel4);
        this.getContentPane().add(testSubClass);
        this.getContentPane().add(jLabel5);
        this.getContentPane().add(jLabel6);
        this.getContentPane().add(jLabel7);
        this.getContentPane().add(itemA);
        this.getContentPane().add(jLabel8);
        this.getContentPane().add(itemB);
        this.getContentPane().add(itemC);
        this.getContentPane().add(jLabel9);
        this.getContentPane().add(jLabel10);
        this.getContentPane().add(itemD);
        this.getContentPane().add(answerA);
        this.getContentPane().add(answerD);
        this.getContentPane().add(answerB);
        this.getContentPane().add(answerC);
        this.getContentPane().add(jLabel12);
        this.getContentPane().add(difficulty);
        this.getContentPane().add(jLabel11);
        this.getContentPane().add(jPanel1);
        jPanel1.add(addButton);
        jPanel1.add(editButton);
        jPanel1.add(cancelButton);
        this.getContentPane().add(jScrollPane1);
        jScrollPane1.getViewport().add(testContent);
        testId.setBounds(new Rectangle(112, 40, 133, 22));
        buttonGroup1.add(answerA);
        buttonGroup1.add(answerD);
        buttonGroup1.add(answerC);
        buttonGroup1.add(answerB);
    }

    JLabel jLabel1 = new JLabel();
    JTextField testId = new JTextField();
    JLabel jLabel2 = new JLabel();
    JTextField testName = new JTextField();
    JLabel jLabel3 = new JLabel();
    JComboBox testType = new JComboBox();
    JLabel jLabel4 = new JLabel();
    JComboBox testSubClass = new JComboBox();
    JLabel jLabel5 = new JLabel();
    JTextArea testContent = new JTextArea();
    JLabel jLabel6 = new JLabel();
    JLabel jLabel7 = new JLabel();
    JTextField itemA = new JTextField();
    JLabel jLabel8 = new JLabel();

⌨️ 快捷键说明

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