📄 studymainframe.java
字号:
package com.hb.studentmanager.ui;
import java.awt.Toolkit;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
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.JScrollPane;
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.StudyAction;
/**
* 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 StudyMainFrame extends javax.swing.JFrame {
private JScrollPane studyjScrollPane;
private JButton headjButton;
private JButton lastjButton;
private JLabel stujLabel;
private JButton backjButton;
private JButton deljButton;
private JButton updatejButton;
private JLabel namejLabel;
private JTextField stujTextField;
private JComboBox weekjComboBox;
private JLabel jLabel1;
private JComboBox yearjComboBox;
private JLabel yearjLabel;
private JButton selectjButton;
private JComboBox monthjComboBox;
private JComboBox mindjComboBox;
private JComboBox studyjComboBox;
private JTextField namejTextField;
private JLabel weekjLabel1;
private JLabel mindjLabel;
private JLabel sdudyjLabel;
private JButton addjButton;
private JPanel studyjPanel;
private JTabbedPane studyjTabbedPane;
private JButton nextjButton;
private JButton upjButton;
private JTable studyjTable;
public DefaultTableModel studyjTableModel;
StudyAction sa=new StudyAction();
private int page=1;
String s1="",s2="",s3="",s4="",s5="",s6="",s7="";
/**
* Auto-generated main method to display this JFrame
*/
public static void main(String[] args) {
StudyMainFrame inst = new StudyMainFrame();
inst.setVisible(true);
}
public StudyMainFrame() {
super();
initGUI();
int width=Toolkit.getDefaultToolkit().getScreenSize().width;
int height=Toolkit.getDefaultToolkit().getScreenSize().height;
this.setLocation((width-630)/2, (height-450)/2);
this.setResizable(false);
}
private void initGUI() {
try {
setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
getContentPane().setLayout(null);
this.setTitle("\u5b66\u751f\u5b66\u4e60\u7ba1\u7406");
{
studyjScrollPane = new JScrollPane();
getContentPane().add(studyjScrollPane);
studyjScrollPane.setBounds(0, 0, 623, 98);
{
gettable(s1,s2,s3,s4,s5,s6,s7);
}
}
{
headjButton = new JButton();
getContentPane().add(headjButton);
headjButton.setText("\u9996\u9875");
headjButton.setBounds(21, 119, 77, 28);
headjButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent evt) {
headjButtonActionPerformed(evt);
}
});
}
{
upjButton = new JButton();
getContentPane().add(upjButton);
upjButton.setText("\u4e0a\u4e00\u9875");
upjButton.setBounds(154, 119, 77, 28);
upjButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent evt) {
upjButtonActionPerformed(evt);
}
});
}
{
nextjButton = new JButton();
getContentPane().add(nextjButton);
nextjButton.setText("\u4e0b\u4e00\u9875");
nextjButton.setBounds(364, 119, 77, 28);
nextjButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent evt) {
nextjButtonActionPerformed(evt);
}
});
}
{
lastjButton = new JButton();
getContentPane().add(lastjButton);
lastjButton.setText("\u5c3e\u9875");
lastjButton.setBounds(518, 119, 77, 28);
lastjButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent evt) {
lastjButtonActionPerformed(evt);
}
});
}
{
studyjTabbedPane = new JTabbedPane();
getContentPane().add(studyjTabbedPane);
studyjTabbedPane.setBounds(0, 182, 623, 189);
{
studyjPanel = new JPanel();
studyjTabbedPane.addTab("查询条件", null, studyjPanel, null);
studyjPanel.setLayout(null);
{
stujLabel = new JLabel();
studyjPanel.add(stujLabel);
stujLabel.setText("\u5b66\u53f7\uff1a");
stujLabel.setBounds(7, 7, 63, 28);
}
{
namejLabel = new JLabel();
studyjPanel.add(namejLabel);
namejLabel.setText("\u59d3\u540d\uff1a");
namejLabel.setBounds(7, 56, 63, 28);
}
{
sdudyjLabel = new JLabel();
studyjPanel.add(sdudyjLabel);
sdudyjLabel.setText("\u5b66\u4e60\u60c5\u51b5\uff1a");
sdudyjLabel.setBounds(7, 112, 77, 28);
}
{
mindjLabel = new JLabel();
studyjPanel.add(mindjLabel);
mindjLabel.setText("\u5fc3\u7406\u60c5\u51b5\uff1a");
mindjLabel.setBounds(280, 7, 77, 28);
}
{
weekjLabel1 = new JLabel();
studyjPanel.add(weekjLabel1);
weekjLabel1.setText("\u5b66\u671f/\u6708/\u5468");
weekjLabel1.setBounds(280, 56, 77, 28);
}
{
stujTextField = new JTextField();
studyjPanel.add(stujTextField);
stujTextField.setBounds(91, 7, 133, 28);
}
{
namejTextField = new JTextField();
studyjPanel.add(namejTextField);
namejTextField.setBounds(91, 56, 133, 28);
}
{
ComboBoxModel studyjComboBoxModel = new DefaultComboBoxModel(
new String[] { null,"不理想", "正常","良好","优秀" });
studyjComboBox = new JComboBox();
studyjPanel.add(studyjComboBox);
studyjComboBox.setModel(studyjComboBoxModel);
studyjComboBox.setBounds(91, 112, 133, 28);
}
{
ComboBoxModel mindjComboBoxModel = new DefaultComboBoxModel(
new String[] { null,"不理想", "正常","良好","优秀" });
mindjComboBox = new JComboBox();
studyjPanel.add(mindjComboBox);
mindjComboBox.setModel(mindjComboBoxModel);
mindjComboBox.setBounds(357, 7, 133, 28);
}
{
ComboBoxModel weekjComboBoxModel = new DefaultComboBoxModel(
new String[]{null,"第一周","第二周","第三周","第四周","第五周"
,"第六周","第七周","第八周","第九周","第十周"
,"第十一周","第十二周","第十三周","第十四周","第十五周","第十六周"
,"第十七月","第十八周"});
weekjComboBox = new JComboBox();
studyjPanel.add(weekjComboBox);
weekjComboBox.setModel(weekjComboBoxModel);
weekjComboBox.setBounds(532, 56, 77, 28);
}
{
ComboBoxModel monthjComboBoxModel = new DefaultComboBoxModel(
new String[]{null,"第一月","第二月","第三月","第四月","第五月"});
monthjComboBox = new JComboBox();
studyjPanel.add(monthjComboBox);
monthjComboBox.setModel(monthjComboBoxModel);
monthjComboBox.setBounds(448, 56, 70, 28);
}
{
selectjButton = new JButton();
studyjPanel.add(selectjButton);
selectjButton.setText("\u67e5\u8be2");
selectjButton.setBounds(532, 126, 77, 28);
selectjButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent evt) {
selectjButtonActionPerformed(evt);
}
});
}
{
yearjLabel = new JLabel();
studyjPanel.add(yearjLabel);
yearjLabel.setText("/");
yearjLabel.setBounds(434, 56, 14, 28);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -