📄 scoremagdialog.java
字号:
package com.hb.stumanagesys.basicinfomaintain;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
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.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JRadioButton;
import javax.swing.JScrollPane;
import javax.swing.JSeparator;
import javax.swing.JTabbedPane;
import javax.swing.JTable;
import javax.swing.JTextField;
import javax.swing.SwingConstants;
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 scoreMagDialog extends javax.swing.JDialog {
private String[][] row;// 行
private String[] column;// 列
private JPanel scorePanel;
private JTabbedPane scoreTabbedPane;
private JButton jButton1;
private JTextField scoreStuTextField;
private JSeparator jSeparator3;
private JLabel jLabel7;
private JButton ExitButton;
private JTextField queryTextField;
private JTable viewTable;
private JSeparator jSeparator2;
private JScrollPane viewScrollPane;
private JTextField examIDTextField;
private JLabel examIDLabel;
private JButton allButton;
private JComboBox termComboBox;
private JLabel jLabel3;
private JButton newButton;
private JSeparator jSeparator1;
private JTextField subNameStuTextField;
private JLabel subNameStuLabel;
private JTextField subIdStuTextField;
private JLabel subIdStuLabel;
private ButtonGroup presentbttonGroup;
private JRadioButton noPresentStuRadioButton;
private JRadioButton isPresentRadioButton;
private JLabel ispresentStuLabel;
private JComboBox testKindStuComboBox;
private JLabel testKindStuLabel;
private JLabel scoreStuLabel;
private JButton deleteButton;
private JButton modifyButton;
private JButton queryButton;
private JTable stuScoreTable;
private JScrollPane stuScoreScrollPane;
private JPanel subjectPanel;
private JPanel stuScorePanel;
private JButton saveStuButton;
private JTextField stuIdTextField;
private JLabel stuIdLabel;
private JTextField nameTextField;
private JLabel nameLabel;
private DefaultTableModel stuScoreTableModel;
/**
* Auto-generated main method to display this JDialog
*/
public static void main(String[] args) {
JFrame frame = new JFrame();
scoreMagDialog inst = new scoreMagDialog(frame);
inst.setVisible(true);
inst.setLocationRelativeTo(null);
}
public scoreMagDialog(JFrame frame) {
super();
initGUI();
try {
initTable();
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
private void initGUI() {
try {
{
this.setTitle("\u6210\u7ee9\u7ba1\u7406");
getContentPane().setLayout(null);
{
{
presentbttonGroup = new ButtonGroup();
}
scorePanel = new JPanel();
getContentPane().add(scorePanel);
scorePanel.setBounds(0, 0, 889, 441);
scorePanel.setLayout(null);
scorePanel.setBackground(new java.awt.Color(170, 173, 242));
{
scoreTabbedPane = new JTabbedPane();
scorePanel.add(scoreTabbedPane);
scoreTabbedPane.setBounds(0, 0, 889, 434);
{
stuScorePanel = new JPanel();
scoreTabbedPane.addTab("学生成绩管理", null,
stuScorePanel, null);
stuScorePanel.setLayout(null);
stuScorePanel
.setPreferredSize(new java.awt.Dimension(
882, 420));
stuScorePanel.setBackground(new java.awt.Color(170,
173, 242));
{
stuScoreScrollPane = new JScrollPane();
stuScorePanel.add(stuScoreScrollPane);
stuScoreScrollPane.setBounds(7, 70, 490, 315);
{
DefaultTableModel stuScoreTableModel = new DefaultTableModel(
row,
column);
stuScoreTable = new JTable();
stuScoreScrollPane.setViewportView(stuScoreTable);
stuScoreTable.setLayout(null);
stuScoreTable.setRowHeight(24);
stuScoreTable.setBounds(7, 70, 476, 217);
stuScoreTable
.addMouseListener(new MouseAdapter() {
public void mouseClicked(
MouseEvent evt) {
stuScoreTableMouseClicked(evt);
}
});
stuScoreTable.setModel(stuScoreTableModel);
}
}
{
nameLabel = new JLabel();
stuScorePanel.add(nameLabel);
nameLabel.setText("\u59d3\u540d");
nameLabel.setBounds(707, 14, 42, 28);
}
{
nameTextField = new JTextField();
stuScorePanel.add(nameTextField);
nameTextField.setBounds(749, 14, 105, 28);
nameTextField.setEnabled(false);
}
{
stuIdLabel = new JLabel();
stuScorePanel.add(stuIdLabel);
stuIdLabel.setText("\u5b66\u53f7");
stuIdLabel.setBounds(539, 14, 63, 28);
{
jSeparator1 = new JSeparator();
stuIdLabel.add(jSeparator1);
jSeparator1.setBounds(-21, -7, -14, 385);
jSeparator1
.setOrientation(SwingConstants.VERTICAL);
}
}
{
stuIdTextField = new JTextField();
stuScorePanel.add(stuIdTextField);
stuIdTextField.setBounds(602, 14, 98, 28);
}
{
saveStuButton = new JButton();
stuScorePanel.add(saveStuButton);
saveStuButton.setText("\u4fdd\u5b58");
saveStuButton.setBounds(714, 273, 70, 21);
saveStuButton
.addActionListener(new ActionListener() {
public void actionPerformed(
ActionEvent evt) {
saveButtonActionPerformed(evt);
}
});
}
{
queryButton = new JButton();
stuScorePanel.add(queryButton);
queryButton.setText("\u67e5\u8be2");
queryButton.setBounds(294, 28, 70, 21);
queryButton
.addActionListener(new ActionListener() {
public void actionPerformed(
ActionEvent evt) {
queryButtonactionPerformed(evt);
// TODO add your code for
// queryButton.actionPerformed
}
});
}
{
modifyButton = new JButton();
stuScorePanel.add(modifyButton);
modifyButton.setText("\u4fee\u6539");
modifyButton.setBounds(714, 238, 70, 21);
modifyButton
.addActionListener(new ActionListener() {
public void actionPerformed(
ActionEvent evt) {
modifyButtonActionPerformed(evt);
}
});
}
{
deleteButton = new JButton();
stuScorePanel.add(deleteButton);
deleteButton.setText("\u5220\u9664");
deleteButton.setBounds(546, 273, 70, 21);
deleteButton
.addActionListener(new ActionListener() {
public void actionPerformed(
ActionEvent evt) {
deleteStuButtonActionPerformed(evt);
}
});
}
{
scoreStuLabel = new JLabel();
stuScorePanel.add(scoreStuLabel);
scoreStuLabel.setText("\u5206\u6570");
scoreStuLabel.setBounds(539, 189, 63, 28);
}
{
scoreStuTextField = new JTextField();
stuScorePanel.add(scoreStuTextField);
scoreStuTextField.setBounds(602, 189, 98, 28);
}
{
testKindStuLabel = new JLabel();
stuScorePanel.add(testKindStuLabel);
testKindStuLabel
.setText("\u8003\u8bd5\u6027\u8d28");
testKindStuLabel.setBounds(539, 119, 63, 28);
}
{
ComboBoxModel testKindStuComboBoxModel = new DefaultComboBoxModel(
new String[] { "1.正常考试", "2.补考",
"3.重修", "4.清考" });
testKindStuComboBox = new JComboBox();
stuScorePanel.add(testKindStuComboBox);
testKindStuComboBox
.setModel(testKindStuComboBoxModel);
testKindStuComboBox.setBounds(602, 119, 91, 28);
}
{
ispresentStuLabel = new JLabel();
stuScorePanel.add(ispresentStuLabel);
ispresentStuLabel.setText("\u51fa\u5e2d\u5426");
ispresentStuLabel.setBounds(539, 154, 63, 28);
}
{
isPresentRadioButton = new JRadioButton();
stuScorePanel.add(isPresentRadioButton);
isPresentRadioButton.setText("Y.出席");
isPresentRadioButton.setBounds(602, 154, 91, 28);
presentbttonGroup.add(isPresentRadioButton);
isPresentRadioButton.setSelected(true);
isPresentRadioButton
.addActionListener(new ActionListener() {
public void actionPerformed(
ActionEvent evt) {
isPresentRadioButtonActionPerformed(evt);
}
});
}
{
noPresentStuRadioButton = new JRadioButton();
stuScorePanel.add(noPresentStuRadioButton);
noPresentStuRadioButton.setText("N.缺考");
noPresentStuRadioButton.setBounds(714, 154, 91, 28);
presentbttonGroup.add(noPresentStuRadioButton);
noPresentStuRadioButton
.addActionListener(new ActionListener() {
public void actionPerformed(
ActionEvent evt) {
noPresentStuRadioButtonActionPerformed(evt);
}
});
}
{
subIdStuLabel = new JLabel();
stuScorePanel.add(subIdStuLabel);
subIdStuLabel.setText("\u79d1\u76ee\u53f7");
subIdStuLabel.setBounds(539, 49, 63, 28);
}
{
subIdStuTextField = new JTextField();
stuScorePanel.add(subIdStuTextField);
subIdStuTextField.setEnabled(false);
subIdStuTextField.setBounds(602, 49, 98, 28);
}
{
subNameStuLabel = new JLabel();
stuScorePanel.add(subNameStuLabel);
subNameStuLabel.setText("\u79d1\u76ee\u540d");
subNameStuLabel.setBounds(707, 49, 42, 28);
}
{
subNameStuTextField = new JTextField();
stuScorePanel.add(subNameStuTextField);
subNameStuTextField.setBounds(749, 49, 105, 28);
subNameStuTextField.setEnabled(false);
}
{
newButton = new JButton();
stuScorePanel.add(newButton);
newButton.setText("\u65b0\u589e");
newButton.setBounds(546, 238, 70, 21);
newButton
.addActionListener(new ActionListener() {
public void actionPerformed(
ActionEvent evt) {
newButtonActionPerformed(evt);
}
});
}
{
jLabel3 = new JLabel();
stuScorePanel.add(jLabel3);
jLabel3.setText("\u6309");
jLabel3.setBounds(14, 21, 42, 28);
}
{
allButton = new JButton();
stuScorePanel.add(allButton);
allButton.setText("\u5237\u65b0");
allButton.setBounds(420, 28, 70, 21);
allButton
.addActionListener(new ActionListener() {
public void actionPerformed(
ActionEvent evt) {
allButtonActionPerformed(evt);
}
});
}
{
examIDLabel = new JLabel();
stuScorePanel.add(examIDLabel);
examIDLabel.setText("\u8003\u8bd5\u7f16\u53f7");
examIDLabel.setBounds(539, 84, 63, 28);
}
{
examIDTextField = new JTextField();
stuScorePanel.add(examIDTextField);
examIDTextField.setBounds(602, 84, 98, 28);
}
{
queryTextField = new JTextField();
stuScorePanel.add(queryTextField);
queryTextField.setBounds(133, 21, 147, 28);
}
{
ExitButton = new JButton();
stuScorePanel.add(ExitButton);
ExitButton.setText("\u9000\u51fa");
ExitButton.setBounds(763, 343, 63, 28);
ExitButton
.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent evt) {
exitButtonActionPerformed(evt);
}
});
}
{
jLabel7 = new JLabel();
stuScorePanel.add(jLabel7);
jLabel7.setText("\u5b66\u53f7");
jLabel7.setBounds(539, 14, 63, 28);
{
jSeparator3 = new JSeparator();
jLabel7.add(jSeparator3);
jSeparator3
.setOrientation(SwingConstants.VERTICAL);
jSeparator3.setBounds(-21, -7, -14, 385);
}
}
{
jButton1 = new JButton();
stuScorePanel.add(jButton1);
jButton1.setText("\u67e5\u8be2");
jButton1.setBounds(294, 28, 70, 21);
jButton1
.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent evt) {
queryButtonactionPerformed(evt);
}
});
}
{
ComboBoxModel termComboBoxModel = new DefaultComboBoxModel(
new String[] { "学号", "姓名" });
termComboBox = new JComboBox();
stuScorePanel.add(termComboBox);
termComboBox.setModel(termComboBoxModel);
termComboBox.setBounds(49, 21, 70, 28);
}
}
{
subjectPanel = new JPanel();
scoreTabbedPane.addTab("结果显示", null, subjectPanel, null);
subjectPanel.setLayout(null);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -