package SI;import java.awt.*;import java.awt.event.*;import java.lang.*;import java.math.*;import java.math.BigDecimal;import static oracle.jrockit.jfr.events.Bits.doubleValue;import static oracle.jrockit.jfr.events.Bits.floatValue;import static oracle.jrockit.jfr.events.Bits.intValue;public class SI extends Frame implements ActionListener{ TextField ptf,rtf,ttf,sitf,atf,citf,atf1; Button ab,sib,cib,ab1; Label pl,rl,tl,sil,al,cil,al1; SI(){ pl=new Label("Principal:"); pl.setBounds(15,50,50,20); ptf=new TextField(); ptf.setBounds(150, 50, 150, 20); rl=new Label("Rate:"); rl.setBounds(15,100,50,20); rtf=new TextField(); rtf.setBounds(150, 100, 150, 20); tl=new Label("Time:"); tl.setBounds(15,150,50,20); ttf=new TextField(); ttf.setBounds(150, 150, 150, 20); sil=new Label("Simple Interest:"); sil.setBounds(15,200,150,20); sitf=new TextField(); sitf.setBounds(150, 200, 150, 20); sitf.setEditable(false); sib=new Button("Simple Interest"); sib.setBounds(120,400,100,50); sib.addActionListener(this); cil=new Label("Compound Interest:"); cil.setBounds(15,250,200,20); citf=new TextField(); citf.setBounds(150, 250, 150, 20); citf.setEditable(false); cib=new Button("Compound Interest"); cib.setBounds(240,400,130,50); cib.addActionListener(this);這個小程序不工作。當我單擊按鈕時,它會引發錯誤。在我將所有 double 更改為 BigDecimal 后,此錯誤開始。請幫幫我。我被困在這里很多天了。這里有什么錯誤。我對 BigDecimal 不太了解。我是新手。請幫幫我。為什么會拋出錯誤?
添加回答
舉報
0/150
提交
取消