📄 tesmainframe.java
字号:
package com.hb.studentmanager.ui;
import java.awt.Toolkit;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import javax.swing.ComboBoxModel;
import javax.swing.DefaultComboBoxModel;
import javax.swing.JButton;
import javax.swing.JComboBox;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JTabbedPane;
import javax.swing.JTable;
import javax.swing.JTextField;
import javax.swing.WindowConstants;
import javax.swing.table.DefaultTableModel;
import javax.swing.table.TableModel;
import com.hb.studentmanager.action.TesAction;
/**
* 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 TesMainFrame extends javax.swing.JFrame {
private JPanel tesPanel;
private JTable tesTable;
private JComboBox tesDate2ComboBox;
private JComboBox tesDateComboBox;
private JLabel tesTeaLabel;
private JLabel tesDateLabel;
private JLabel tesAddLabel;
private JLabel subidLabel;
private JLabel tesidLabel;
private JPanel tesPanel2;
private JTabbedPane TabbedPane;
private JButton okButton;
private JButton tesDelButton;
private JButton tesUpdteButton;
private JButton tesAddButton;
private JButton finalButton;
private JTextField adTextField;
private JTextField subidTextField;
private JTextField teTextField;
private JTextField teaTextField;
private JButton selectButton;
private JLabel Label1;
private JButton nextButton;
private JButton firstButton;
private JButton lastButton;
String test[]={"考试编号","科目代号","考试时间","考试地点","监考人员"};
private TesAction ta=new TesAction();
private int page=1;
int row;
private boolean selectflag=false;
public static void main(String[] args) {
TesMainFrame inst = new TesMainFrame();
inst.setVisible(true);
inst.setResizable(false);
}
public TesMainFrame() {
super("考试表");
initGUI();
int width=Toolkit.getDefaultToolkit().getScreenSize().width;
int height=Toolkit.getDefaultToolkit().getScreenSize().height;
this.setLocation((width-630)/2, (height-450)/2);
}
private void initGUI() {
try {
setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
getContentPane().setLayout(null);
{
tesPanel = new JPanel();
getContentPane().add(tesPanel);
tesPanel.setLayout(null);
tesPanel.setBounds(0, 0, 623, 420);
{
TableModel tesTableModel = new DefaultTableModel(
new String[][] { test, {},{},{},{},{} },
new String[] { "","","","",""});
tesTable = new JTable();
tesPanel.add(tesTable);
tesTable.setModel(tesTableModel);
tesTable.setBounds(0, 0, 623, 98);
tesTable.addMouseListener(new MouseAdapter() {
public void mouseReleased(MouseEvent evt) {
tesTableMouseReleased(evt);
}
public void mousePressed(MouseEvent evt) {
tesTableMousePressed(evt);
}
public void mouseExited(MouseEvent evt) {
tesTableMouseExited(evt);
}
public void mouseEntered(MouseEvent evt) {
tesTableMouseEntered(evt);
}
public void mouseClicked(MouseEvent evt) {
tesTableMouseClicked(evt);
}
});
ta.init(tesTable,1,5);
}
{
lastButton = new JButton();
tesPanel.add(lastButton);
lastButton.setText("\u4e0a\u4e00\u9875");
lastButton.setBounds(154, 119, 77, 28);
lastButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent evt) {
lastButtonActionPerformed(evt);
}
});
}
{
firstButton = new JButton();
tesPanel.add(firstButton);
firstButton.setText("\u9996\u9875");
firstButton.setBounds(21,119,77,28);
firstButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent evt) {
firstButtonActionPerformed(evt);
}
});
}
{
nextButton = new JButton();
tesPanel.add(nextButton);
nextButton.setText("\u4e0b\u4e00\u9875");
nextButton.setBounds(364, 119, 77, 28);
nextButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent evt) {
nextButtonActionPerformed(evt);
}
});
}
{
finalButton = new JButton();
tesPanel.add(finalButton);
finalButton.setText("\u5c3e\u9875");
finalButton.setBounds(518, 119, 77, 28);
finalButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent evt) {
finalButtonActionPerformed(evt);
}
});
}
{
tesAddButton = new JButton();
tesPanel.add(tesAddButton);
tesAddButton.setText("\u6dfb\u52a0");
tesAddButton.setBounds(14, 375, 77, 28);
tesAddButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent evt) {
tesAddButtonActionPerformed(evt);
}
});
}
{
tesUpdteButton = new JButton();
tesPanel.add(tesUpdteButton);
tesUpdteButton.setText("\u4fee\u6539");
tesUpdteButton.setBounds(140, 375, 77, 28);
tesUpdteButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent evt) {
tesUpdteButtonActionPerformed(evt);
}
});
}
{
tesDelButton = new JButton();
tesPanel.add(tesDelButton);
tesDelButton.setText("\u5220\u9664");
tesDelButton.setBounds(266, 375, 77, 28);
tesDelButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent evt) {
tesDelButtonActionPerformed(evt);
}
});
}
{
okButton = new JButton();
tesPanel.add(okButton);
okButton.setText("\u8fd4\u56de");
okButton.setBounds(399, 375, 77, 28);
okButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent evt) {
okButtonActionPerformed(evt);
}
});
}
{
TabbedPane = new JTabbedPane();
tesPanel.add(TabbedPane);
TabbedPane.setBounds(0, 168, 623, 196);
{
tesPanel2 = new JPanel();
TabbedPane.addTab("查询条件", null, tesPanel2, null);
tesPanel2.setLayout(null);
tesPanel2.setPreferredSize(new java.awt.Dimension(618, 170));
{
tesidLabel = new JLabel();
tesPanel2.add(tesidLabel);
tesidLabel.setText("\u8003\u8bd5\u7f16\u53f7\uff1a");
tesidLabel.setBounds(49, 14, 77, 28);
}
{
subidLabel = new JLabel();
tesPanel2.add(subidLabel);
subidLabel.setText("\u79d1\u76ee\u4ee3\u53f7\uff1a");
subidLabel.setBounds(308, 14, 77, 28);
}
{
tesAddLabel = new JLabel();
tesPanel2.add(tesAddLabel);
tesAddLabel.setText("\u8003\u8bd5\u5730\u70b9\uff1a");
tesAddLabel.setBounds(49, 70, 77, 28);
}
{
tesDateLabel = new JLabel();
tesPanel2.add(tesDateLabel);
tesDateLabel.setText("\u8003\u8bd5\u65f6\u95f4\uff1a");
tesDateLabel.setBounds(49, 127, 70, 28);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -