预览加载中,请您耐心等待几秒...
1/10
2/10
3/10
4/10
5/10
6/10
7/10
8/10
9/10
10/10

亲,该文档总共29页,到这已经超出免费预览范围,如果喜欢就直接下载吧~

如果您无法下载资料,请参考说明:

1、部分资料下载需要金币,请确保您的账户上有足够的金币

2、已购买过的文档,再次下载不重复扣费

3、资料包下载后请先用软件解压,在使用对应软件打开

bm.java importjava.awt.*; importjava。awt。event.*; importjava.sql。*; importjavax.swing.*; classbmextendsFrameimplementsActionListener,ItemListener {privatecondbconx=null; privateResultSetrs=null; privateStringsql=null; privateLabelnum=newLabel("职工号"); privateLabeljb=newLabel("税收"); privateLabelfj=newLabel(”医疗保险”); privateLabelin=newLabel("退休保险”); privateTextFieldnumtx=newTextField(); privateTextFieldjbtx=newTextField(); privateTextFieldfjtx=newTextField(); privateTextFieldintx=newTextField(); privateChoicenumcho=newChoice(); privateButtonadd=newButton("增加”); privateButtonexit=newButton(”退出”); publicbm() {setTitle("扣除工资"); setSize(400,300); setBackground(Color.LIGHT_GRAY); this。setLocationRelativeTo(this。getParent()); this。setResizable(false); setLayout(null); num.setBounds(80,50,50,20); jb。setBounds(80,80,50,20); fj。setBounds(80,110,50,20); in.setBounds(80,140,50,20); numtx.setBounds(160,50,100,20); jbtx.setBounds(160,80,100,20); fjtx.setBounds(160,110,100,20); intx。setBounds(160,140,100,20); numcho。setBounds(160,170,100,20); add.setBounds(60,220,50,20); exit.setBounds(300,220,50,20); add(add); add(exit); add(num); add(jb); add(fj); add(in); add(numtx); add(jbtx); add(fjtx); add(intx); add(numcho); //lb add。addActionListener(this); exit.addActionListener(this); numcho。addItemListener(this); initnumcho(); setVisible(true); addWindowListener(newWindowAdapter() {publicvoidwindowClosing(WindowEvente) {dispose();} } ); } publicvoiditemStateChanged(ItemEventi) {numtx。setText(numcho.getSelectedItem()); } publicvoidinitnumcho() {conx=newcondb(); sql="select*from扣除工资”; numcho.removeAll(); try{rs=conx.getrs(conx.con,sql); while(rs.next()) {numcho.add(rs.getString(”职工号"));} conx.dbclose(conx.con,rs); conx=null; rs=null; } catch(Exceptioneo){} } publicvoidactionPerformed(ActionEvente) {conx=newcondb(); if(e。getActionCommand().equals(”退出")) this.dispose(); if(e.getActionCommand()。equals("增加”)) { sql=”select*from扣除工资where职工号=’”+numtx.getText()+"'"; try{rs=conx.getrs(conx.con