actionperformed.txt
来自「ejb的学习资料」· 文本 代码 · 共 27 行
TXT
27 行
public void actionPerformed (ActionEvent e) {
String str = amount.getText();
if ( str.equals(" ") {
return;
}
try {
if ( e.getSource() == addFunds ) {
balance = (double) manager.addFunds(balance,
Double.parseDouble(amount.getText()));
currencyFormatter = NumberFormat.getCurrencyInstance();
strBal = currencyFormatter.format (balance);
status.setText (mag + strBal);
}
if( e.getsource() == withdrawFunds ) {
balance = (double ) manager.withdrawFunds (balance,
Double.parseDouble(amount.getText()));
//设置新的结余。
currencyFormatter = NumberFormat.getCurrencyInstance();
strBal = currencyFormatter.format (balance) ;
status.setText (msg + strBal);
}
} catch (Exception ex ) {
ex.printStackTrace ( );
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?