功能以它为模板 实现它能实现的功能 有什么我们觉得还不够人性化的咱们自己在补充 你们说这样好不好
我下的是博信药店管理系统(含GSP管理) 你们有兴趣的话下载来看看吧
什么时候才能成为论坛游民啊....
那个药店的管理程序我现在还没写出来 不过我可以帖一个我前几天写的一个
程序 时间匆忙 连批注也没写上 而且还没有通过编译 还有很多错误
大家帮我看看好吗 不过说好了 可以批评我 可不要笑话我啊
public class Yinhang extends JFrame {
private JTextArea xianshiJTextArea;
private JTextField zhanghuJTextField;
private JTextField jineJTextField;
private JPasswordField mimaJPasswordField;
private JButton JButton0;
private JButton JButton1;
private JButton JButton2;
private JButton JButton3;
private JButton JButton4;
private JButton JButton5;
private JButton JButton6;
private JButton JButton7;
private JButton JButton8;
private JButton JButton9;
private JButton guanliyuanJButton;
private JButton yonghuJButton;
private JButton chaxunJButton;
private JButton lishiJButton;
private JButton cunkuanJButton;
private JButton qukuanJButton;
private JButton fenghaoJButton;
private JButton tuichuJButton;
private JButton xinjianJButton;
private JButton quedingJButton;
private JButton jiechufenghaoJButton;
private JButton genggaimimaJButton;
private JLabel zhanghuJLabel;
private JLabel mimaJLabel;
private JLabel jineJLabel;
private JComboBox bizongJComboBox;
private String guanliyuanzhanghao="123";
private String guanliyuanmima="123";
private String jzhanghu,jmima;
private String guanzhanghu,guanmima;
private String zhanghu,mima;
private String DATEBASEDRIVER="sun.jdbc.odbc.JdbcOdbcDriver";
private String DATEBASEURL="jdbc:odbc:myfrist";
private String[] countries;
private int dengluzhi=1;
private int janquan,jsuoding;
private Connection myConnection;
private Statement myStatement;
private PreparedStatement myPreparedStatement;
private ResultSet myResultSet;
private Date jshijian,jsuodingdate,jjinggaodate;
private double jjine;
private double MEIYUAN=8.6;
private double RENMINBI=1;
private double RIYUAN=0.07;
public Yinhang{
creatuserinterface();
}
private void creatuserinterface(){
Container contentPane=getContentPane();
contentPane.setLayout(null);
xianshiJTextArea=new JTextArea();
xianshiJTextArea.setBounds(0,0,560,300);
xianshiJTextArea.setEditable(false);
contentPane.add(xianshiJTextArea);
zhanghuJLabel=new JLabel();
zhanghuJLabel.setBounds(0,300,100.60);
zhanghuJLabel.setText("帐户");
contentPane.add(zhanghuJLabel);
mimaJLabel=new JLabel();
mimaJLabel.setBounds(0,360,100.60);
mimaJLabel.setText("密码");
contentPane.add(mimaJLabel);
jineJLabel=new JLabel();
jineJLabel.setBounds(0,420,100.60);
jineJLabel.setText("金额");
contentPane.add(jineJLabel);
zhanghuJTextField=new JTextField();
zhanghuJTextField.setBounds(100,300,160,60);
contentPane.add(zhanghuJTextField);
jineJTextField=new JTextField();
jineJTextField.setBounds(100,420,160,60);
contentPane.add(jineJTextField);
mimaJPasswordField=new JPasswordField();
mimaJPasswordField.setBounds(100,360,160,60);
contentPane.add(mimaJPasswordField);
bizongJComboBox=new JComboBox(countries);
bizongJComboBox.setBounds(0,480,260,60);
bizongJComboBox.setMaximumRowCount(3);
contentPane.add(bizongJComboBox);
JButton0=new JButton();
JButton0.setBounds(150.840.100.80);
JButton0.setText("0");
JButton0.setEditable(false);
contentPane.add(JButton0);
JButton1.addActionListener(
new ActionListener() {
public void actionPerformed( ActionEvent event ){
oneTonineJButtonActionPerformed( event );
}
}
);
JButton1=new JButton();
JButton1.setBounds(50.600.100.80);
JButton1.setText("1");
JButton1.setEditable(false);
contentPane.add(JButton1);
JButton1.addActionListener(
new ActionListener() {
public void actionPerformed( ActionEvent event ){
oneTonineJButtonActionPerformed("1");
}
}
);
JButton2=new JButton();
JButton2.setBounds(150.600.100.60);
JButton2.setText("2");
JButton2.setEditable(false);
contentPane.add(JButton2);
JButton2.addActionListener(
new ActionListener() {
public void actionPerformed( ActionEvent event ){
oneTonineJButtonActionPerformed("2");
}
}
);
JButton3=new JButton();
JButton3.setBounds(250.600.100.80);
JButton3.setText("3");
JButton3.setEditable(false);
contentPane.add(JButton3);
JButton3.addActionListener(
new ActionListener() {
public void actionPerformed( ActionEvent event ){
oneTonineJButtonActionPerformed("3");
}
}
);
JButton4=new JButton();
JButton4.setBounds(50.680.100.80);
JButton4.setText("4");
JButton4.setEditable(false);
contentPane.add(JButton4);
JButton4.addActionListener(
new ActionListener() {
public void actionPerformed( ActionEvent event ){
oneTonineJButtonActionPerformed("4");
}
}
);
JButton5=new JButton();
JButton5.setBounds(150.680.100.80);
JButton5.setText("5");
JButton5.setEditable(false);
contentPane.add(JButton5);
JButton5.addActionListener(
new ActionListener() {
public void actionPerformed( ActionEvent event ){
oneTonineJButtonActionPerformed("5");
}
}
);
JButton6=new JButton();
JButton6.setBounds(250.680.100.80);
JButton6.setText("6");
JButton6.setEditable(false);
contentPane.add(JButton6);
JButton6.addActionListener(
new ActionListener() {
public void actionPerformed( ActionEvent event ){
oneTonineJButtonActionPerformed( "6" );
}
}
);
JButton7=new JButton();
JButton7.setBounds(50.760.100.80);
JButton7.setText("7");
JButton7.setEditable(false);
contentPane.add(JButton7);
JButton7.addActionListener(
new ActionListener() {
public void actionPerformed( ActionEvent event ){
oneTonineJButtonActionPerformed("7");
}
}
);
JButton8=new JButton();
JButton8.setBounds(150.760.100.80);
JButton8.setText("8");
JButton8.setEditable(false);
contentPane.add(JButton8);
JButton8.addActionListener(
new ActionListener() {
public void actionPerformed( ActionEvent event ){
oneTonineJButtonActionPerformed("8");
}
}
);
JButton9=new JButton();
JButton9.setBounds(250.760.100.80);
JButton9.setText("9");
JButton9.setEditable(false);
contentPane.add(JButton9);
JButton9.addActionListener(
new ActionListener() {
public void actionPerformed( ActionEvent event ){
oneTonineJButtonActionPerformed("9");
}
}
);
guanliyuanJButton =new JButton();
guanliyuanJButton.setBounds(360.300.200.60);
guanliyuanJButton.setText("管理员登陆");
guanliyunanJButton.addActionListener(
new ActionListener() {
public void actionPerformed( ActionEvent event ){
guanliyuanJButtonActionPerformed( event );
}
}
);
contentPane.add(guanliyuanJButton);
yonghuJButton =new JButton();
yonghuJButton.setBounds(360.360.200.60);
yonghuJButton.setText("用户登陆");
yonghuJButton.addActionListener(
new ActionListener() {
public void actionPerformed( ActionEvent event ){
yonghuJButtonActionPerformed( event );
}
}
);
contentPane.add(yonghuJButton);
chaxunJButton =new JButton();
chaxunJButton.setBounds(360.420.200.60);
chaxunJButton.setText("查询");
chaxunJButton.setEditable(false);
chaxunJButton.addActionListener(
new ActionListener() {
public void actionPerformed( ActionEvent event ){
chaxunJButtonActionPerformed( event );
}
}
);
contentPane.add(chaxunJButton);
lishiJButton =new JButton();
lishiJButton.setBounds(360.480.200.60);
lishiJButton.setText("历史记录");
lishiJButton.setEditable(false);
lishiJButton.addActionListener(
new ActionListener() {
public void actionPerformed( ActionEvent event ){
lishiJButtonActionPerformed( event );
}
}
);
contentPane.add(lishiJButton);
cunkuanJButton =new JButton();
cunkuanJButton.setBounds(360.520.200.60);
cunkuanJButton.setText("存款");
cunkuanJButton.setEditable(false);
cunkuanJButton.addActionListener(
new ActionListener() {
public void actionPerformed( ActionEvent event ){
cunkuanJButtonActionPerformed( event );
}
}
);
contentPane.add(cunkuanJButton);
qukuanJButton =new JButton();
qukuanJButton.setBounds(360.580.200.60);
qukuanJButton.setText("取款");
qukuanJButton.setEditable(false);
qukuanJButton.addActionListener(
new ActionListener() {
public void actionPerformed( ActionEvent event ){
qukuanJButtonActionPerformed( event );
}
}
);
contentPane.add(qucunkuanJButton);
fenghaoJButton =new JButton();
fenghaoJButton.setBounds(360.640.200.60);
fenghaoJButton.setText("封号");
fenghaoJButton.setEditable(false);
fenghaoJButton.addActionListener(
new ActionListener() {
public void actionPerformed( ActionEvent event ){
fenghaoJButtonActionPerformed( event );
}
}
);
contentPane.add(fenghaoJButton);
jiechufenghaoJButton =new JButton();
jiechufenghaoJButton.setBounds(360.700.200.60);
jiechufenghaoJButton.setText("解除封号");
jiechuJButton.setEditable(false);
jiechufenghaoJButton.addActionListener(
new ActionListener() {
public void actionPerformed( ActionEvent event ){
jiechufenghaoJButtonActionPerformed( event );
}
}
);
contentPane.add(jiechufenghaoJButton);
xinjianJButton =new JButton();
xinjianJButton.setBounds(360.760.200.60);
xinjianJButton.setText("新建帐号");
xinjianJButton.addActionListener(
new ActionListener() {
public void actionPerformed( ActionEvent event ){
xinjianJButtonActionPerformed( event );
}
}
);
contentPane.add(xinjianJButton);
tuichuJButton =new JButton();
tuichuJButton.setBounds(360.820.200.60);
tuichuJButton.setText("退出当前帐号");
tuichuJButton.setEditable(false);
tuichuJButton.addActionListener(
new ActionListener() {
public void actionPerformed( ActionEvent event ){
tuichuJButtonActionPerformed( event );
}
}
);
contentPane.add(tuichuJButton);
genggaiJButton =new JButton();
genggaiJButton.setBounds(360.880.200.60);
genggaiJButton.setText("更改密码");
genggaiJButton.setEditable(false);
genggaiJButton.addActionListener(
new ActionListener() {
public void actionPerformed( ActionEvent event ){
genggaiJButtonActionPerformed( event );
}
}
);
contentPane.add(genggaiJButton);
quedingJButton=new JButton();
quedingJButton.setEditable(false);
quedingJButton.setBounds(260.300.60.60);
quedingJButton.setText("确定");
quedingJButton.addActionListener(
new ActionListener() {
public void actionPerformed( ActionEvent event ){
quedingJButtonActionPerformed( event );
}
}
);
contentPane.add(quedingJButton);
setTitle("银行帐户系统");
setSize(560,960);
setVisible(true);
}
private void guanliyuanJButtonActionPerformed(ActionEvent event ){
if((zhanghuJTextField.getText()=="")||(mimaJTextField.getText()==""))
{xianshiJTextArea.setText("请输入帐号和密码");
zhanghuJTextField.setEditable(true);
xinjianJButton.setEditable(false);
yonghuJButton.setEditable(false);
mimaPasswordField.setEditable(true);
quedingJButton.setEditable(true);
JButton0.setEditable(true);
JButton1.setEditable(true);
JButton2.setEditable(true);
JButton3.setEditable(true);
JButton4.setEditable(true);
JButton5.setEditable(true);
JButton6.setEditable(true);
JButton7.setEditable(true);
JButton8.setEditable(true);
JButton9.setEditable(true);
}
else{
guanzanghu=zhanghuJTextField.getText();
guanmima=mimaPasswordField.getText();
if((guanzhanghu==guanliyuanzhanghu)&&(guanmima==gnanliyuanmima))
{dengluzhi=1;
zhanghuJTextField.setEditable(false);
mimaPasswordField.setEditable(false);
zhanghuJTextField.setText("");
mimaPasswordField.setText("");
xianshiJTextArea.setText("管理员登陆成功");
yonghuJButton.setEditable(false);
guanliyuanJButton.setEditable(false);
xinjianJButton.setEditable(true);
chaxunJButton.setEditable(true);
lishiJButton.setEditable(true);
fenghaoJButton.setEditable(true);
jiechufenghaoJButton.setEditable(true);
tuichuJButton.setEditable(true);
JButton0.setEditable(false);
JButton1.setEditable(false);
JButton2.setEditable(false);
JButton3.setEditable(false);
JButton4.setEditable(false);
JButton5.setEditable(false);
JButton6.setEditable(false);
JButton7.setEditable(false);
JButton8.setEditable(false);
JButton9.setEditable(false);
}
else {xianshiJTextArea.setText("管理员帐号密码不正确请重新登陆");
guanliyuanJButtonActionPerformed(event );
}
}
}
private void yonghuJButtonActionPerformed(ActionEvent event ){
if((zhanghuJTextField.getText()=="")||(mimaPasswordField.getText()==""))
{xianshiJTextArea.setText("请输入帐号和密码");
mimaPasswordField.setEditable(true);
yonghuJButton.setEditable(true);
quedingJButton.setEditable(true);
guanliyuanJButton.setEditable(false);
xinjianJButton.setEditable(false);
JButton0.setEditable(true);
JButton1.setEditable(true);
JButton2.setEditable(true);
JButton3.setEditable(true);
JButton4.setEditable(true);
JButton5.setEditable(true);
JButton6.setEditable(true);
JButton7.setEditable(true);
JButton8.setEditable(true);
JButton9.setEditable(true);
}
else {
zhanghu=zhanghuJTextField.getText();
mima=mimaPasswordField.getText();
Class.forName(DATEBASEDRIVER);
myConnection=DriverManager.getConnection(DATEBASEURL);
myStatement=myConnection.creatStatement();
myResultSet=myStatement.executeQuery("SELECT zhanghuku FROM Yinhangzhanghu");
int t=0;
String a;
while (myResultSet.next()&&(t==o))
{a=myResultSet.getString("zhanghuku");
if (a==zhanghu) t=1;
}
if(t==0)
{xianshiJTextArea.setText("数据库无此信息");
myResultSet.close();
myStatement.close();
myConnection.close();
tuichuJButtonActionPerformed( event );
}
else{myResultSet.close();
myResultSet=myStatement.executeQuery("SELECT zhanghuku,mimaku,anquanku,suodingku,suodingdateku,jingbaodateku FROM Yinhangzhanghu WHERE zhanghuku='"+zhanghu+"'");
jsuoding=myResultSet.getInt("suodingku");
Date dangqiandate=new Date();
jsuodingdate=myResultSet.getDate("suodingdateku");
if((jsuoding==0)&&panduansuoding(jsuodingdate,dangqiandate))
{
myResultSet.close();
myStatement.close();
myConnection.close();
xianshiJTextArea.setText("此帐号已经被锁定 锁定日期为"+jsuodingdate+"锁定时间为60秒");
tuichuJButtonActionPerformed( event );
}
else{
jmima=myResultSet.getString("mimaku");
janquan=myResultSet.getInt("anquanku");
if(jmima=mima)
{
if(janquan==0)
{
myResultSet.close();
myStatement.executeUpdate("UPDATE Yinhangzhanghu SET jinbaoku=1 WHERE zhanghuku='"+zhanghu+"'");
Date nowdate =new Date();
myStatement.executeUpdate("UPDATE Yinhangzhanghu SET jingbaodateku='"+nowdate +"'"+"WHERE zhanghuku='"+zhanghu+"'");
myStatement.close();
myConnection.close();
tuichuJButtonActionPerformed( event );
xianshiJTextArea.setText("帐号密码错误 第一次警告 若30秒内再错两次 将对此帐号封号");
}
else if (janquan==1){
jjinggaodate =myResultSet.getDate("jinggaodateku");
Date nowdate =new Date();
if(panduanjinggao(jjinggaodate,nowdate)){
myResultSet.close();
myStatement.executeUpdate("UPDATE Yinhangzhanghu SET jingbaodateku='"+nowdate+"'"+"WHERE zhanghuku='"+zhanghu+"'");
myStatement.close();
myConnection.close();
tuichuJButtonActionPerformed();
xianshiJTextArea.setText("帐号密码错误 第一次警告 若30秒内再错两次 将对此帐号封号");
}
else if(!(panduanjinggao(jjinggaodate,nowdate))){
myResultSet.close();
myStatement.executeUpdate("UPDATE Yinhangzhanghu SET jinbaoku=2 WHERE zhanghuku='"+zhanghu+"'");
myStatement.close();
myConnection.close();
tuichuJButtonActionPerformed();
xianshiJTextArea.setText("帐号密码错误 第二次警告
若30秒内再错两次 将对此帐号封号");
}
}
else if(janquan==2){
jjinggaodate=myResultSet.getDate("jinggaodateku");
Date nowdate =new Date();
if(panduanjinggao(jjinggaodate,nowdate)){
fenghaoJButtonActionPerformed( event );
myResultSet.close();
myStatement.close();
myConnection.close();
tuichuJButtonActionPerformed( event );
xianshiJTextArea.setText("已经连帐号连续3次输错 此帐号已经被封号 60秒内无法登陆 请与管理员联系");
}
else if {
myResultSet.close();
myStatement.executeUpdate("UPDATE Yinhangzhanghu SET jingbaodateku='"+nowdate+"'"+"WHERE zhanghuku='"+zhanghu+"'");
myStatement.executeUpdate("UPDATE Yinhangzhanghu SET jinbaoku=1 WHERE zhanghuku='"+zhanghu+"'");
myStatement.close();
myConnection.close();
tuichuJButtonActionPerformed();
xianshiJTextArea.setText("帐号密码错误 第一次警告
若30秒内再错两次 将对此帐号封号");
}
}
else {
myResultSet.close();
myStatement.executeUpdate("UPDATE Yinhangzhanghu SET jinbaoku=2 WHERE zhanghuku='"+zhanghu+"'");
myStatement.close();
myConnection.close();
xianshiJTextArea.setText("用户登陆成功");
zhanghuJTextField.setText("");
mimaPasswordField.setText("");
yonghuJButton.setEditable(false);
guanliyuanJButton.setEditable(false);
xinjianJButton.setEditable(false);
chaxunJButton.setEditable(true);
lishiJButton.setEditable(true);
fenghaoJButton.setEditable(false);
jiechufenghaoJButton.setEditable(false);
tuichuJButton.setEditable(true);
cunkuanJButton.setEditable(true);
qukuanJButton.setEditable(true);
genggaimimaJButton.setEditable(true);
quedingJButton.setEditable(false);
JButton0.setEditable(false);
JButton1.setEditable(false);
JButton2.setEditable(false);
JButton3.setEditable(false);
JButton4.setEditable(false);
JButton5.setEditable(false);
JButton6.setEditable(false);
JButton7.setEditable(false);
JButton8.setEditable(false);
JButton9.setEditable(false);
dengluzhi=0;
}
}
}
}
}//定义结束
private void genggaimimaJButtonActionPerformed(ActionEvent event ){
if(mimaJPasswordField.getText()==""){
mimaJPasswordField.setEditable(true);
JButton0.setEditable(true);
JButton1.setEditable(true);
JButton2.setEditable(true);
JButton3.setEditable(true);
JButton4.setEditable(true);
JButton5.setEditable(true);
JButton6.setEditable(true);
JButton7.setEditable(true);
JButton8.setEditable(true);
JButton9.setEditable(true);
xianshiJTextArea.setText("请输入新密码");
}
else {
mima=mimaJPasswordField.getText();
Class.forName(DATEBASEDRIVER);
myConnection=DriverManager.getConnection(DATEBASEURL);
myStatement=myConnection.creatStatement();
myStatement.executeUpdate("UPDATE Yinhangzhanghu SET mimaku='"+mima+"'"+"WHERE zhanghuku='"+zhanghu+"'");
myResultSet.close();
myStatement.close();
myConnection.close();
mimaJPasswordField.setText("");
mimaJPasswordField.setEditable(false);
JButton0.setEditable(false);
JButton1.setEditable(false);
JButton2.setEditable(false);
JButton3.setEditable(false);
JButton4.setEditable(false);
JButton5.setEditable(false);
JButton6.setEditable(false);
JButton7.setEditable(false);
JButton8.setEditable(false);
JButton9.setEditable(false);
xianshiJTextArea.setText("修改新密码成功");
}
}//定义结束
private void tuichuJButtonActionPerformed(ActionEvent event ){
framewinclose();
guanliyuanJButton.setEditable(true);
yonghuJButton.setEditable(true);
chaxunJButton.setEditable(false);
lishiJButton.setEditable(false);
cunkuanJButton.setEditable(false);
qukuanJButton.setEditable(false);
fenghaoJButton.setEditable(false);
tuichuJButton.setEditable(false);
xinjianJButton.setEditable(true);
quedingJButton.setEditable(false);
jiechufenghaoJButton.setEditable(false);
genggaimimaJButton.setEditable(false);
zhanghuJTextField.setEditable(false);
mimaJPasswordField.setEditable(false);
jineJTextField.setEditable(false);
zhanghuJTextField.setText("");
mimaJPasswordField.setText("");
jineJTextField.setText("");
bizongJComboBox.setEditable(false);
JButton0.setEditable(false);
JButton1.setEditable(false);
JButton2.setEditable(false);
JButton3.setEditable(false);
JButton4.setEditable(false);
JButton5.setEditable(false);
JButton6.setEditable(false);
JButton7.setEditable(false);
JButton8.setEditable(false);
JButton9.setEditable(false);
}//定义结束
private void fenghaoJButtonActionPerformed(ActionEvent event ){
if(zhanghuJTextField.getText()==""){
zhanghuJTextField.setEditable(true);
JButton0.setEditable(true);
JButton1.setEditable(true);
JButton2.setEditable(true);
JButton3.setEditable(true);
JButton4.setEditable(true);
JButton5.setEditable(true);
JButton6.setEditable(true);
JButton7.setEditable(true);
JButton8.setEditable(true);
JButton9.setEditable(true);
xianshiJTextArea.setText("请输入要封的号");
}
else {
zhanghu=zhanghuJTextField.getText();
Class.forName(DATEBASEDRIVER);
myConnection=DriverManager.getConnection(DATEBASEURL);
myStatement=myConnection.creatStatement();
myStatement.executeUpdate("UPDATE Yinhangzhanghu SET suodingku='"+1+"'"+"WHERE zhanghuku='"+zhanghu+"'");
myResultSet.close();
myStatement.close();
myConnection.close();
zhanghuJTextfield.setText("");
zhanghuJTextField.setEditable(false);
xianshiJTextArea.setText("封号成功");
}
}//结束
private void jiechufenghaoJButtonActionPerformed(ActionEvent event ){
if(zhanghuJTextField.getText()==""){
zhanghuJTextField.setEditable(true);
JButton0.setEditable(true);
JButton1.setEditable(true);
JButton2.setEditable(true);
JButton3.setEditable(true);
JButton4.setEditable(true);
JButton5.setEditable(true);
JButton6.setEditable(true);
JButton7.setEditable(true);
JButton8.setEditable(true);
JButton9.setEditable(true);
xianshiJTextArea.setText("请输入要封的号");
}
else {
zhanghu=zhanghuJTextField.getText();
Class.forName(DATEBASEDRIVER);
myConnection=DriverManager.getConnection(DATEBASEURL);
myStatement=myConnection.creatStatement();
myStatement.executeUpdate("UPDATE Yinhangzhanghu SET suodingku=0 anquanku=0 WHERE zhanghuku='"+zhanghu+"'");
myResultSet.close();
myStatement.close();
myConnection.close();
zhanghuJTextfield.setText("");
zhanghuJTextField.setEditable(false);
xianshiJTextArea.setText("解除封号成功");
}
}//结束
private boolean panduanjinggao(Date date1,Date date2){
if((date2.GetTime()-date1.GetTime())>30000) return true;
else return false;
}
private boolean panduansuoding(Date date1,Date date2){
if((date2.GetTime()-date1.GetTime())<60000) return true;
else return false;
}
private void oneTonineJButtonActionPerformed(String number){
if(zhanghuJTextField.getsetEditable())
zhanghuJTextField.setText(zhanghuJTextField.getText()+number);
else if(!zhanghuJTextField.getsetEditable()&&mimaJPasswordField.getsetEditable())
mimaJPasswordField.setText(mimaJPasswordField.getText()+number);
else if(!zhanghuJTextField.getsetEditable()&&!mimaJPasswordField.getsetEditable())
jineJTextField.setText(jineJTextField.getText()+number);
}
private void quedingJButtonActionPerformed(ActionEvent event ){
zhanghuJTextField.setEditable(false);
quedingJButton.setEditable(false);
}
private void chuangjianxinbiao(String a,String b,String,c){
Class.forName(DATEBASEDRIVER);
myConnection=DriverManager.getConnection(DATEBASEURL);
myStatement=myConnection.creatStatement();
myStatement.executeUpdate("CREATE TABLE Yinhangzhanghu"+zhanghu+"(shijianjilu CHAR(30),jinejilu CHAR(30);)");
myResultSet.close();
myStatement.close();
myConnection.close();
}
private void framewinclose(WindowEvent event){
if (!myResultSet.close()) myResultSet.close();
if (!myStatement.close()) myStatement.close();
if (!myConnection.close()) myConnection.close();
}
private String zhanghufuzhi(){
String a,b;
zhanghuJTextField.setEditable(true);
JButton0.setEditable(true);
JButton1.setEditable(true);
JButton2.setEditable(true);
JButton3.setEditable(true);
JButton4.setEditable(true);
JButton5.setEditable(true);
JButton6.setEditable(true);
JButton7.setEditable(true);
JButton8.setEditable(true);
JButton9.setEditable(true);
zhanghuJTextField.setText("");
quedingJButton.setEditable(true);
xianshiJTextArea.setText("请输入帐号并点击确定");
while (!zhanghuJTextField.getEditable()){
a=zhanghuJTextField.getText();
Class.forName(DATEBASEDRIVER);
myConnection=DriverManager.getConnection(DATEBASEURL);
myStatement=myConnection.creatStatement();
myResultSet=myStatement.executeQuery("SELECT zhanghuku FROM Yinhangzhanghu");
int i=0;
while (myResultSet.next()&&(i==0)){
b=myResultSet.getString("zhanghuku");
if(a==b) i=1;
}
if (i==0) a='0';
return a;
}
}
}
public static void main (String[] args){
Yinhang yinhang=new Yinghang();
application.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
}
}