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

📄 itemmanagerframe.java

📁 支持GUI和持久对象的联机测试系统
💻 JAVA
📖 第 1 页 / 共 2 页
字号:
/*
 * ItemManagerFrame.java
 * 
 * MSE06B班张智力的实验报告
 * 
 * 2006年12月11日
 */

package olts.display;

import java.awt.*;
import javax.swing.*;
import java.awt.GridLayout;
import javax.swing.JRadioButton;
import java.awt.GridBagLayout;
import java.awt.GridBagConstraints;

import javax.swing.JOptionPane;
import javax.swing.JTextPane;
import javax.swing.JTable;
import javax.swing.table.TableColumn;
import java.awt.FlowLayout;
import javax.swing.JScrollPane;
import java.awt.BorderLayout;
import javax.swing.JPanel;
import javax.swing.JComboBox;
import java.awt.Scrollbar;
import javax.swing.JSpinner.NumberEditor;
import olts.dao.ItemMapper;
import olts.item.*;
import olts.util.ErrorRecorder;

/**
 * ItemManagerFrame类,继承了JFrame,生成试题维护系统的程序界面
 */
public class ItemManagerFrame extends JFrame {

    private JPanel jContentPane = null;
    private JTabbedPane jTabbedPane = null;
    private JPanel jPanel = null;
    private JPanel jPanel1 = null;
    private JScrollPane jScrollPane = null;
    private JTable jTable = null;
	private JPanel jPanel2 = null;
	private JPanel jPanel3 = null;
	private JPanel jPanel4 = null;
	private JPanel jPanel5 = null;
	private JPanel jPanel6 = null;
	private JPanel jPanel7 = null;
	private JLabel jLabel = null;
	private JComboBox jComboBox = null;
	private JLabel jLabel1 = null;
	private JTextField jTextField = null;
	private JTextField jTextField1 = null;
	private JTextField jTextField2 = null;
	private JTextField jTextField3 = null;
	private JTextField jTextField4 = null;
    private JRadioButton jRadioButton = null;
    private JRadioButton jRadioButton1 = null;
    private JRadioButton jRadioButton2 = null;
    private JRadioButton jRadioButton3 = null;
    private JLabel jLabel2 = null;
    private JComboBox jComboBox1 = null;
    private JLabel jLabel3 = null;
    private JLabel jLabel4 = null;
    private JButton jButton = null;
    private JSpinner jspinner = null;
    private JSpinner jspinner1 = null;
    private JSpinner.NumberEditor numberEditor = null;
    private JSpinner.NumberEditor numberEditor1 = null;
    private JLabel jLabel5 = null;
    private JTextField jTextField5 = null;
    
    public ItemManagerFrame() throws HeadlessException {
        super();
        // TODO 自动生成构造函数存根

        initialize();
    }

    public ItemManagerFrame(GraphicsConfiguration arg0) {
        super(arg0);
        // TODO 自动生成构造函数存根

        initialize();
    }

    public ItemManagerFrame(String arg0) throws HeadlessException {
        super(arg0);
        // TODO 自动生成构造函数存根

        initialize();
    }

    public ItemManagerFrame(String arg0, GraphicsConfiguration arg1) {
        super(arg0, arg1);
        // TODO 自动生成构造函数存根

        initialize();
    }

    /**
     * This method initializes jTabbedPane	
     * 	
     * @return javax.swing.JTabbedPane	
     */
    private JTabbedPane getJTabbedPane() {
        if (jTabbedPane == null) {
            jTabbedPane = new JTabbedPane();
            jTabbedPane.addTab("添 加", null, getJPanel(), null);
            jTabbedPane.addTab("更 新", null, getJPanel1(), null);
        }
        return jTabbedPane;
    }

    /**
     * This method initializes jPanel	
     * 	
     * @return javax.swing.JPanel	
     */
    private JPanel getJPanel() {
        if (jPanel == null) {
            GridLayout gridLayout = new GridLayout();
            gridLayout.setRows(6);
            gridLayout.setHgap(3);
            gridLayout.setVgap(4);
            gridLayout.setColumns(1);
            jPanel = new JPanel();
            jPanel.setLayout(gridLayout);
            jPanel.add(getJPanel2(), null);
            jPanel.add(getJPanel3(), null);
            jPanel.add(getJPanel4(), null);
            jPanel.add(getJPanel5(), null);
            jPanel.add(getJPanel6(), null);
            jPanel.add(getJPanel7(), null);
        }
        return jPanel;
    }

    /**
     * This method initializes jPanel1	
     * 	
     * @return javax.swing.JPanel	
     */
    private JPanel getJPanel1() {
        if (jPanel1 == null) {
            jPanel1 = new JPanel();
            jPanel1.setLayout(new BorderLayout());
            jPanel1.add(getJScrollPane(), java.awt.BorderLayout.CENTER);
        }
        return jPanel1;
    }

    /**
     * This method initializes jScrollPane	
     * 	
     * @return javax.swing.JScrollPane	
     */
    private JScrollPane getJScrollPane() {
        if (jScrollPane == null) {
            jScrollPane = new JScrollPane();
            jScrollPane.setViewportView(getJTable());
        }
        return jScrollPane;
    }

    /**
     * This method initializes jTable	
     * 	
     * @return javax.swing.JTable	
     */
    private JTable getJTable() {
        if (jTable == null) {
            String columnsName[] = {"序号", "题目", "标准答案", "难度", "分数", "答题时间", "科目"};
            jTable = new JTable();
        }
        return jTable;
    }

    /**
	 * This method initializes jPanel2	
	 * 	
	 * @return javax.swing.JPanel	
	 */
	private JPanel getJPanel2() {
		if (jPanel2 == null) {
			jLabel = new JLabel();
			jLabel.setText("题 型:");
			jLabel.setFont(new java.awt.Font("宋体", java.awt.Font.PLAIN, 15));
			jLabel.setPreferredSize(new java.awt.Dimension(70,40));
			jPanel2 = new JPanel();
			jPanel2.add(jLabel, null);
			jPanel2.add(getJComboBox(), null);
		}
		return jPanel2;
	}

	/**
	 * This method initializes jPanel3	
	 * 	
	 * @return javax.swing.JPanel	
	 */
	private JPanel getJPanel3() {
		if (jPanel3 == null) {
			jLabel1 = new JLabel();
			jLabel1.setText("题目:");
			jLabel1.setFont(new java.awt.Font("宋体", java.awt.Font.PLAIN, 15));
			jLabel1.setPreferredSize(new java.awt.Dimension(50,40));
			jPanel3 = new JPanel();
			jPanel3.setLayout(new FlowLayout());
			jPanel3.add(jLabel1, null);
			jPanel3.add(getJTextField(), null);
		}
		return jPanel3;
	}

	/**
	 * This method initializes jPanel4	
	 * 	
	 * @return javax.swing.JPanel	
	 */
	private JPanel getJPanel4() {
		if (jPanel4 == null) {
			jPanel4 = new JPanel();
			jPanel4.add(getJRadioButton(), null);
			jPanel4.add(getJTextField1(), null);
			jPanel4.add(getJRadioButton1(), null);
			jPanel4.add(getJTextField2(), null);
		}
		return jPanel4;
	}

	/**
	 * This method initializes jPanel5	
	 * 	
	 * @return javax.swing.JPanel	
	 */
	private JPanel getJPanel5() {
		if (jPanel5 == null) {
			jPanel5 = new JPanel();
			jPanel5.add(getJRadioButton2(), null);
			jPanel5.add(getJTextField3(), null);
			jPanel5.add(getJRadioButton3(), null);
			jPanel5.add(getJTextField4(), null);
		}
		return jPanel5;
	}

	/**
	 * This method initializes jPanel6	
	 * 	
	 * @return javax.swing.JPanel	
	 */
	private JPanel getJPanel6() {
		if (jPanel6 == null) {
			jLabel5 = new JLabel();
			jLabel5.setText("标准答案: ");
			jLabel4 = new JLabel();
			jLabel4.setText("答题时间:");
			FlowLayout flowLayout = new FlowLayout();
			flowLayout.setHgap(10);
			flowLayout.setVgap(12);
			jLabel3 = new JLabel();
			jLabel3.setText("分数:");
			jLabel2 = new JLabel();
			jLabel2.setText("难度:");
			jPanel6 = new JPanel();
			jPanel6.setLayout(flowLayout);
			jPanel6.add(jLabel5, null);
			jPanel6.add(getJTextField5(), null);
			jPanel6.add(jLabel2, null);
			jPanel6.add(getJComboBox1(), null);
			jPanel6.add(jLabel3, null);
            jPanel6.add(getJSpinner(), null);
			jPanel6.add(jLabel4, null);
            jPanel6.add(getJSpinner1(), null);
		}
		return jPanel6;
	}

	/**
	 * This method initializes jPanel7	
	 * 	
	 * @return javax.swing.JPanel	
	 */
	private JPanel getJPanel7() {
		if (jPanel7 == null) {
			FlowLayout flowLayout1 = new FlowLayout();
			flowLayout1.setVgap(10);
			jPanel7 = new JPanel();
			jPanel7.setLayout(flowLayout1);
			jPanel7.add(getJButton(), null);
		}
		return jPanel7;
	}

	/**
	 * This method initializes jComboBox	
	 * 	
	 * @return javax.swing.JComboBox	
	 */
	private JComboBox getJComboBox() {

⌨️ 快捷键说明

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