Object source=e.
getSource();
if(source==btnBack){
Menu panel = new Menu();
panel.setSize(330,300);
panel.setVisible(true);
panel.setResizable(false);
panel.setLocation(400,250);
dispose();
}else if(source==btnDep){
try{
try{
st= cn.createStatement();
ResultSet rs=st.executeQuery("SELECT * FROM tbl_list
WHERE Username ='"+txtuser.getText()+"'");
while(rs.next()){
txtcash.setText(rs.getString(9));
int a =
Integer.parseInt(txtcash.getText());
int b =
Integer.parseInt(txtwid.getText());
int sum = a+b;
txtcash.setText((sum + ""));
txtwid.setText("");
JOptionPane.showMessageDialog(null,"You Deposit
" + b,"ATM",JOptionPane.INFORMATION_MESSAGE);
ps = cn.prepareStatement("UPDATE tbl_list SET ct = '" + sum
+ "' WHERE Username = '" + txtuser.getText() + "'");
ps.executeUpdate();
txtuser.requestFocus(true);
}
st.close();
}catch(NumberFormatException nfe){
JOptionPane.showMessageDialog(null,"Enter now the amount to
Deposit","ATM",JOptionPane.INFORMATION_MESSAGE);
}catch(SQLException s){
System.out.println("No record found!\n\n\n");
System.out.println("SQL Error" + s.toString() + " " +
s.getErrorCode() + " " + s.getSQLState());
}
catch(Exception x){
System.out.println("Error" + x.toString()+" " +
x.getMessage());
}