📄 actionperformed.txt
字号:
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 + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -