📄 yuangong.java~9~
字号:
package zhican;
import java.awt.BorderLayout;
import javax.swing.JFrame;
import javax.swing.JLabel;
import java.awt.*;
import javax.swing.JTextField;
import javax.swing.JButton;
import java.awt.event.*;
import java.sql.*;
import java.util.ArrayList;
public class yuangong extends JFrame {
public yuangong() {
try {
jbInit();
} catch (Exception exception) {
exception.printStackTrace();
}
}
private void jbInit() throws Exception {
getContentPane().setLayout(null);
jLabel1.setText("员工编号");
jLabel1.setBounds(new Rectangle(14, 15, 60, 29));
jTextField4.setBounds(new Rectangle(64, 125, 106, 27));
jTextField3.setBounds(new Rectangle(64, 89, 106, 27));
jTextField2.setBounds(new Rectangle(64, 53, 106, 27));
jTextField1.setBounds(new Rectangle(64, 17, 106, 27));
jLabel4.setText("备注");
jLabel4.setBounds(new Rectangle(14, 122, 60, 29));
jLabel3.setText("职位");
jLabel3.setBounds(new Rectangle(14, 86, 60, 29));
jButton1.addActionListener(new yuangong_jButton1_actionAdapter(this));
jButton2.addActionListener(new yuangong_jButton2_actionAdapter(this));
jButton4.addActionListener(new yuangong_jButton4_actionAdapter(this));
jButton3.addActionListener(new yuangong_jButton3_actionAdapter(this));
this.getContentPane().add(jLabel2);
jButton4.setBounds(new Rectangle(96, 204, 68, 29));
jButton4.setText("查询");
jButton3.setBounds(new Rectangle(18, 204, 68, 29));
jButton3.setText("修改");
jButton2.setBounds(new Rectangle(96, 165, 68, 29));
jButton2.setText("删除");
jButton1.setBounds(new Rectangle(18, 165, 68, 29));
jButton1.setText("增加");
this.getContentPane().add(jLabel1);
this.getContentPane().add(jLabel3);
this.getContentPane().add(jLabel4);
this.getContentPane().add(jTextField1);
this.getContentPane().add(jTextField2);
this.getContentPane().add(jTextField3);
this.getContentPane().add(jTextField4);
this.getContentPane().add(jButton2);
this.getContentPane().add(jButton1);
this.getContentPane().add(jButton4);
this.getContentPane().add(jButton3);
jLabel2.setText("员工姓名");
jLabel2.setBounds(new Rectangle(14, 51, 60, 29));
String a=jTextField2.getText();
String b=jTextField3.getText();
String c=jTextField4.getText();
}
JLabel jLabel1 = new JLabel();
JLabel jLabel2 = new JLabel();
JLabel jLabel3 = new JLabel();
JLabel jLabel4 = new JLabel();
JTextField jTextField1 = new JTextField();
JTextField jTextField2 = new JTextField();
JTextField jTextField3 = new JTextField();
JTextField jTextField4 = new JTextField();
JButton jButton1 = new JButton();
JButton jButton2 = new JButton();
JButton jButton3 = new JButton();
JButton jButton4 = new JButton();
void jButton1_actionPerformed(ActionEvent e) {
String a=jTextField2.getText();
String b=jTextField3.getText();
String c=jTextField4.getText();
sql obj=new sql();
obj.getsta();
obj.zhengjia(a,b,c);
}
void jButton2_actionPerformed(ActionEvent e) {
String a=jTextField2.getText();
String b=jTextField3.getText();
String c=jTextField4.getText();
sql obj=new sql();
obj.getsta();
obj.shanchu(a,b,c);
}
void jButton4_actionPerformed(ActionEvent e) {
String a=jTextField1.getText();
sql obj=new sql();
obj.getsta();
ArrayList aoo=new ArrayList();
aoo=obj.xinxi(a);
jTextField2.setText(aoo.get(0).toString());
jTextField3.setText(aoo.get(1).toString());
jTextField4.setText(aoo.get(2).toString());
javax.swing.JOptionPane.showMessageDialog(this,"成功");
}
void jButton3_actionPerformed(ActionEvent e) {
String d=jTextField1.getText();
String a=jTextField2.getText();
String b=jTextField3.getText();
String c=jTextField4.getText();
sql obj=new sql();
obj.getsta();
obj.xiugai(a,b,c,d);
}
}
class yuangong_jButton1_actionAdapter implements java.awt.event.ActionListener {
yuangong adaptee;
yuangong_jButton1_actionAdapter(yuangong adaptee) {
this.adaptee = adaptee;
}
public void actionPerformed(ActionEvent e) {
adaptee.jButton1_actionPerformed(e);
}
}
class yuangong_jButton2_actionAdapter implements java.awt.event.ActionListener {
yuangong adaptee;
yuangong_jButton2_actionAdapter(yuangong adaptee) {
this.adaptee = adaptee;
}
public void actionPerformed(ActionEvent e) {
adaptee.jButton2_actionPerformed(e);
}
}
class yuangong_jButton4_actionAdapter implements java.awt.event.ActionListener {
yuangong adaptee;
yuangong_jButton4_actionAdapter(yuangong adaptee) {
this.adaptee = adaptee;
}
public void actionPerformed(ActionEvent e) {
adaptee.jButton4_actionPerformed(e);
}
}
class yuangong_jButton3_actionAdapter implements java.awt.event.ActionListener {
yuangong adaptee;
yuangong_jButton3_actionAdapter(yuangong adaptee) {
this.adaptee = adaptee;
}
public void actionPerformed(ActionEvent e) {
adaptee.jButton3_actionPerformed(e);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -