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

📄 selectexamdialog.java

📁 学生管理系统。使用java编程
💻 JAVA
📖 第 1 页 / 共 2 页
字号:
package com.hb.stumanagesys.universquery;

import java.awt.BorderLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.sql.SQLException;
import java.util.Vector;
import javax.swing.ButtonGroup;
import javax.swing.ComboBoxModel;
import javax.swing.DefaultComboBoxModel;

import javax.swing.JButton;
import javax.swing.JComboBox;

import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JList;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JRadioButton;
import javax.swing.JScrollPane;
import javax.swing.JTabbedPane;
import javax.swing.JTable;
import javax.swing.JTextField;
import javax.swing.ListModel;
import javax.swing.table.DefaultTableModel;
import javax.swing.table.TableModel;

import com.hb.jdbcconnct.JdbcConnct;

/**
 * This code was edited or generated using CloudGarden's Jigloo SWT/Swing GUI
 * Builder, which is free for non-commercial use. If Jigloo is being used
 * commercially (ie, by a corporation, company or business for any purpose
 * whatever) then you should purchase a license for each developer using Jigloo.
 * Please visit www.cloudgarden.com for details. Use of Jigloo implies
 * acceptance of these licensing terms. A COMMERCIAL LICENSE HAS NOT BEEN
 * PURCHASED FOR THIS MACHINE, SO JIGLOO OR THIS CODE CANNOT BE USED LEGALLY FOR
 * ANY CORPORATE OR COMMERCIAL PURPOSE.
 */
public class SelectExamDialog extends javax.swing.JDialog {
	private JPanel examQueryPanel;

	private JTable examQueryTable;

	private DefaultTableModel examSelModel = new DefaultTableModel();
	private JButton exitButton;
	private JButton clearExamQueryButton;
	private JButton addExamQueryButton;
	private JList studentQueryList1;
	private JRadioButton nullRadioButton1;
	private JRadioButton andRadioButton1;
	private JRadioButton orRadioButton1;
	private JComboBox logicSymbloComboBox;
	private JPanel dataViewPanel;
	private JPanel jPanel1;
	private JTabbedPane examQueryTabbedPane;
	private JComboBox examQueryTypeComboBox;

	private JButton selectButton;

	private JTextField userInputTextField;

	private JScrollPane examQueryScrollPane;
	

	//考试表表头
	private String[] columnExam = { "科目号", "科目名", "监考教师工号", "监考人姓名", "开始时间",
			"结束时间", "考试地点", "考试类型", "参考人数", "备注" };
    //考试表信息显示
	private String[][] row;
	//考试表表格模型
	DefaultTableModel examQueryTableModel;
	
	// 判断条件
	private String[] comCompareList = { ">", "<", "=" };
	// 定义SQL多条件查询变量
	public Vector vecSQL = new Vector(20);

	// 定义List显示变量 vecListView
	public Vector vecListView = new Vector(20);
	private ButtonGroup examQuerybuttonGroup;
	// 定义考试查询条件数量初始化为1
	int ncountExam = 1;
	// 定义科目号正则表达式7位数字,第一位不能为空
	public final static String REG_DIGITCOURSE = "[1-9]\\d{0,6}";

		/**
	 * Auto-generated main method to display this JDialog
	 */
	public static void main(String[] args) {
		JFrame frame = new JFrame();
		SelectExamDialog inst = new SelectExamDialog(frame);
		inst.setVisible(true);
		//设置对话框居中
		inst.setLocationRelativeTo(null);
	}

	public SelectExamDialog(JFrame frame) {
		super(frame);
		initGUI();
	}

	private void initGUI() {
		try {
			this.setTitle("考试安排综合查询");
			{
				{
					examQuerybuttonGroup = new ButtonGroup();
				}
				examQueryPanel = new JPanel();
				getContentPane().add(examQueryPanel, BorderLayout.CENTER);
				examQueryPanel.setLayout(null);
				examQueryPanel.setBackground(new java.awt.Color(170, 173, 242));
				examQueryPanel.setPreferredSize(new java.awt.Dimension(861, 441));
				{
					examQueryTabbedPane = new JTabbedPane();
					examQueryPanel.add(examQueryTabbedPane);
					examQueryTabbedPane.setBounds(21, 21, 539, 406);
					{
						jPanel1 = new JPanel();
						examQueryTabbedPane.addTab("考试查询", null, jPanel1, null);
						jPanel1.setLayout(null);
						{
							ComboBoxModel jComboBox1Model = new DefaultComboBoxModel(
								new String[] { "科目号", "科目名" });
							examQueryTypeComboBox = new JComboBox();
							jPanel1.add(examQueryTypeComboBox);
							examQueryTypeComboBox.setModel(jComboBox1Model);
							examQueryTypeComboBox.setBounds(21, 14, 70, 28);
							examQueryTypeComboBox
								.addActionListener(new ActionListener() {
								public void actionPerformed(ActionEvent evt) {
									examQueryTypeComboBoxActionPerformed(evt);
								}
								});
						}
						{
							userInputTextField = new JTextField();
							jPanel1.add(userInputTextField);
							userInputTextField.setBounds(189, 14, 84, 28);
						}
						{
							selectButton = new JButton();
							jPanel1.add(selectButton);
							selectButton.setText("\u67e5\u8be2");
							selectButton.setBounds(21, 301, 70, 21);
							selectButton
								.addActionListener(new ActionListener() {
									public void actionPerformed(ActionEvent evt) {
										selectButtonActionPerformed(evt);
									}
								});
						}
						{
							exitButton = new JButton();
							jPanel1.add(exitButton);
							exitButton.setText("\u9000\u51fa");
							exitButton.setBounds(420, 322, 63, 28);
							exitButton.addActionListener(new ActionListener() {
								public void actionPerformed(ActionEvent evt) {
									exitButtonActionPerformed(evt);
								}
							});
						}
						{
							ComboBoxModel jComboBox2Model = new DefaultComboBoxModel(
								this.comCompareList);
							logicSymbloComboBox = new JComboBox();
							jPanel1.add(logicSymbloComboBox);
							logicSymbloComboBox.setModel(jComboBox2Model);
							logicSymbloComboBox.setBounds(105, 14, 70, 28);
						}
						{
							orRadioButton1 = new JRadioButton();
							jPanel1.add(orRadioButton1);
							orRadioButton1.setText("\u6216\u8005");
							orRadioButton1.setBounds(168, 77, 70, 21);
							examQuerybuttonGroup.add(orRadioButton1);
						}
						{
							andRadioButton1 = new JRadioButton();
							jPanel1.add(andRadioButton1);
							andRadioButton1.setText("\u5e76\u4e14");
							andRadioButton1.setBounds(98, 77, 70, 21);
							examQuerybuttonGroup.add(andRadioButton1);
						}
						{
							nullRadioButton1 = new JRadioButton();
							jPanel1.add(nullRadioButton1);
							nullRadioButton1.setText("\u65e0");
							nullRadioButton1.setSelected(true);
							nullRadioButton1.setBounds(28, 77, 70, 21);
							examQuerybuttonGroup.add(nullRadioButton1);
						}
						{
							ListModel studentQueryList1Model = new DefaultComboBoxModel(
								);
							studentQueryList1 = new JList();
							jPanel1.add(studentQueryList1);
							studentQueryList1.setModel(studentQueryList1Model);
							studentQueryList1.setBounds(28, 112, 203, 161);
						}
						{
							addExamQueryButton = new JButton();
							jPanel1.add(addExamQueryButton);
							addExamQueryButton.setText("\u589e\u52a0");
							addExamQueryButton.setBounds(189, 301, 70, 21);
							addExamQueryButton
								.addActionListener(new ActionListener() {
								public void actionPerformed(ActionEvent evt) {
									addExamQueryButtonActionPerformed(evt);
								}
								});
						}
						{
							clearExamQueryButton = new JButton();
							jPanel1.add(clearExamQueryButton);
							clearExamQueryButton.setText("\u6e05\u7a7a");
							clearExamQueryButton.setBounds(105, 301, 70, 21);
							clearExamQueryButton
								.addActionListener(new ActionListener() {
								public void actionPerformed(ActionEvent evt) {
									clearExamQueryButtonActionPerformed(evt);
								}
								});
						}
					}
					{
						dataViewPanel = new JPanel();
						examQueryTabbedPane.addTab("查询结果", null, dataViewPanel, null);
						dataViewPanel.setLayout(null);
						{
							examQueryScrollPane = new JScrollPane();
							dataViewPanel.add(examQueryScrollPane);
							examQueryScrollPane.setBounds(14, 28, 490, 343);
							{
								examQueryTableModel = new DefaultTableModel(
									row,
									columnExam);
								examQueryTable = new JTable();
								examQueryScrollPane
									.setViewportView(examQueryTable);
								examQueryTable.setModel(examQueryTableModel);
								examQueryTable.setBounds(14, 14, 742, 399);
								examQueryTable.setRowHeight(24);
							}
						}

⌨️ 快捷键说明

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