⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 gzcx.java

📁 工资管理系统的软件.是同许设计的 是一个比较完整的工资管理系统
💻 JAVA
字号:
import java.awt.*;
import java.awt.event.*;
import java.sql.*;

import javax.swing.*;
import java.awt.Window;
 class gzcx extends Frame implements ActionListener
{  private condb conc=null;
   private ResultSet rs=null;
   private String sql=null;
   private Label chao=new Label("职工号:");
   private Label cjb=new Label("基本工资:");
   private Label cfj=new Label("附加工资:");
   private Label csf=new Label("实发工资:");
   private Label in=new Label("所属部门");
   private TextField chaotx=new TextField();
   private Label cjbtx=new Label("");
   private Label cfjtx=new Label("");
   private Label csftx=new Label("");
   private Label intx=new Label("");
   private Button cx=new Button("查询");
   private Button tc=new Button("退出");
  public gzcx()
  { setTitle("工资查询");
    setSize(400,250);
    setBackground(Color.LIGHT_GRAY);
    this.setLocationRelativeTo(this.getParent());
    this.setResizable(false);
    setLayout(null);
    chao.setBounds(80,50,50,20);
    cjb.setBounds(80,80,50,20);
    cfj.setBounds(80,110,50,20);
    csf.setBounds(80,140,50,20);
    in.setBounds(80,170,50,20);
    intx.setBounds(160,170,150,20);
    chaotx.setBounds(160,50,150,20);
    cjbtx.setBounds(160,80,150,20);
    cfjtx.setBounds( 160,110,150,20);
    csftx.setBounds(160,140,150,20);
    cx.setBounds(60,205,50,20);
    tc.setBounds(300,205,50,20);
    add(chao);
    add(cjb);
    add(in);
    add(cfj);
    add(csf);
    add(intx);
    add(cjbtx);
    add(cfjtx);
    add(chaotx);
    add(csftx);
    add(cx);
    add(tc);
    setVisible(true);
    cx.addActionListener(this);
    tc.addActionListener(this);
    addWindowListener(new WindowAdapter()
                      { public void windowClosing(WindowEvent e)
                         {dispose();}
                       }
                      );  
 }
  public void actionPerformed(ActionEvent e)
  { if(e.getActionCommand().equals("退出"))
      this.dispose();
    if(e.getActionCommand().equals("查询"))
     { conc=new condb();
       sql="select * from 工资 where 职工号='"+chaotx.getText()+"'";
        try { 
              rs=conc.getrs(conc.con,sql);
        	  if(rs.next())
        	  
        	  {
              cjbtx.setText(rs.getString("基本工资"));
              cfjtx.setText(rs.getString("附加工资"));
              csftx.setText(rs.getString("实发工资"));
              intx.setText(rs.getString("所属部门"));
              conc.dbclose(conc.con,rs);
              conc=null;
              rs=null;}
             
             else {JOptionPane jop=new JOptionPane();
                   jop.showConfirmDialog(null,"该用户不存在!","警告",-1);
                   }
           }catch(Exception ee){}
     }
   
}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -