📄 dutyupdateframe.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.JScrollPane;
import javax.swing.JTextArea;
import javax.swing.JTextField;
import javax.swing.WindowConstants;
import com.hb.studentmanager.action.DutyAction;
/**
* 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 DutyUpdateFrame extends javax.swing.JDialog {
public JLabel stuidjLabel;
public JLabel datejLabel;
public JLabel beizjLabel;
public JTextField stuidjTextField;
public JTextField datejTextField;
public JComboBox chuqjComboBox;
public JScrollPane beizjScrollPane;
public JButton submjButton;
public JTextArea beizjTextArea;
public JLabel chuqinjLabel;
/**
* Auto-generated main method to display this JFrame
*/
public static void main(String[] args) {
DutyUpdateFrame inst = new DutyUpdateFrame();
inst.setVisible(true);
}
public DutyUpdateFrame() {
super();
initGUI();
int width=Toolkit.getDefaultToolkit().getScreenSize().width;
int height=Toolkit.getDefaultToolkit().getScreenSize().height;
this.setLocation((width-450)/2, (height-470)/2);
}
private void initGUI() {
try {
setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
getContentPane().setLayout(null);
this.setTitle("\u4fee\u6539\u5b66\u751f\u51fa\u52e4");
{
stuidjLabel = new JLabel();
getContentPane().add(stuidjLabel);
stuidjLabel.setText("\u5b66\u53f7\uff1a");
stuidjLabel.setBounds(84, 49, 63, 28);
}
{
datejLabel = new JLabel();
getContentPane().add(datejLabel);
datejLabel.setText("\u51fa\u52e4\u65f6\u95f4\uff1a");
datejLabel.setBounds(84, 140, 70, 28);
}
{
chuqinjLabel = new JLabel();
getContentPane().add(chuqinjLabel);
chuqinjLabel.setText("\u51fa\u52e4\u60c5\u51b5\uff1a");
chuqinjLabel.setBounds(84, 231, 70, 28);
}
{
beizjLabel = new JLabel();
getContentPane().add(beizjLabel);
beizjLabel.setText("\u5907\u6ce8\uff1a");
beizjLabel.setBounds(84, 322, 63, 28);
}
{
stuidjTextField = new JTextField();
getContentPane().add(stuidjTextField);
stuidjTextField.setBounds(182, 49, 126, 28);
stuidjTextField.setEditable(false);
}
{
datejTextField = new JTextField();
getContentPane().add(datejTextField);
datejTextField.setBounds(182, 140, 126, 28);
datejTextField.setEditable(false);
}
{
ComboBoxModel chuqjComboBoxModel = new DefaultComboBoxModel(
new String[] { null,"正常", "迟到","早退","旷课"});
chuqjComboBox = new JComboBox();
getContentPane().add(chuqjComboBox);
chuqjComboBox.setModel(chuqjComboBoxModel);
chuqjComboBox.setBounds(182, 231, 126, 28);
}
{
beizjScrollPane = new JScrollPane();
getContentPane().add(beizjScrollPane);
beizjScrollPane.setBounds(182, 315, 119, 91);
{
beizjTextArea = new JTextArea();
beizjScrollPane.setViewportView(beizjTextArea);
beizjTextArea.setBounds(364, 343, 63, 28);
beizjTextArea.setLineWrap(true);
}
}
{
submjButton = new JButton();
getContentPane().add(submjButton);
submjButton.setText("\u63d0\u4ea4");
submjButton.setBounds(357, 371, 77, 28);
submjButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent evt) {
submjButtonActionPerformed(evt);
}
});
}
pack();
setSize(470, 450);
} catch (Exception e) {
e.printStackTrace();
}
}
private void submjButtonActionPerformed(ActionEvent evt) {
DutyAction da=new DutyAction();
try {
if(beizjTextArea.getText().getBytes().length>100){
JOptionPane.showMessageDialog(this, "输入字数太长");
}
else{
JOptionPane.showConfirmDialog(this, "是否确定修改","警告!",JOptionPane.OK_OPTION);
da.updateDuty(this);
this.setVisible(false);
}
} catch (Exception e) {
// TODO: handle exception
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -