inside a button click can we put following code...
Account a = new Account();
a.setAccNo(Integer.parseInt(txtAccNo.getText()));
a.setDepositamt(Float.parseFloat(txtAmt.getText()));
AccountService as = new AccountServiceImpl();
as.depositMoney(a.getAccNo(),a.getDepositamt());
JOptionPane.showMessageDialog(null,"Table Updated!");
all lines are coorect?