isChoiseOptType=false;
} else if (e.getSource().equals(b9)) {
this.temp.append(b9.getLabel());
this.textField.setText(this.temp.toString());
isChoiseOptType=false;
} else if (e.getSource().equals(bp)) {
if(this.temp.length()=0)
this.temp.append("0");
this.temp.append(bp.getLabel());
this.textField.setText(this.temp.toString());
isChoiseOptType=false;
} else if (e.getSource().equals(ba)) {
if(!isChoiseOptType){
value=https://www.04ip.com/post/this.textField.getText();
if(value.lastIndexOf(".")==value.length()-1){
value=https://www.04ip.com/post/value.substring(0,value.length()-1);
}
this.optValue=https://www.04ip.com/post/value;
this.temp=new StringBuffer("");
}
this.optType=ba.getLabel();
isChoiseOptType=true;
} else if (e.getSource().equals(bs)) {
if(!isChoiseOptType){
value=https://www.04ip.com/post/this.textField.getText();
if(value.lastIndexOf(".")==value.length()-1){
value=https://www.04ip.com/post/value.substring(0,value.length()-1);
}
this.optValue=https://www.04ip.com/post/value;
this.temp=new StringBuffer("");
}
this.optType=bs.getLabel();
isChoiseOptType=true;
} else if (e.getSource().equals(bm)) {
if(!isChoiseOptType){
value=https://www.04ip.com/post/this.textField.getText();
if(value.lastIndexOf(".")==value.length()-1){
value=https://www.04ip.com/post/value.substring(0,value.length()-1);
}
this.optValue=https://www.04ip.com/post/value;
this.temp=new StringBuffer("");
}
this.optType=bm.getLabel();
isChoiseOptType=true;
} else if (e.getSource().equals(bd)) {
if(!isChoiseOptType){
value=https://www.04ip.com/post/this.textField.getText();
if(value.lastIndexOf(".")==value.length()-1){
value=https://www.04ip.com/post/value.substring(0,value.length()-1);
}
this.optValue=https://www.04ip.com/post/value;
this.temp=new StringBuffer("");
}
this.optType=bd.getLabel();
isChoiseOptType=true;
}else if (e.getSource().equals(be)) {
if(!this.optType.equals("")){
BigDecimal opt1=new BigDecimal(this.optValue);
value=https://www.04ip.com/post/this.textField.getText();
if(value.lastIndexOf(".")==value.length()-1){
value=https://www.04ip.com/post/value.substring(0,value.length()-1);
}
BigDecimal opt2=new BigDecimal(value);
BigDecimal result=new BigDecimal(0);
if(this.optType.equals("+")){
result=opt1.add(opt2);
}else if(this.optType.equals("-")){
result=opt1.subtract(opt2);
}else if(this.optType.equals("*")){
result=opt1.multiply(opt2);
}else if(this.optType.equals("/")){
result=opt1.divide(opt2);
}else if(this.optType.equals("%")){
result=opt1.remainder(opt2);
}
this.textField.setText(result.toString());
this.temp=new StringBuffer("");
isChoiseOptType=false;
this.optValue="https://www.04ip.com/post/0";
}
} else if (e.getSource().equals(bc)) {
this.temp=new StringBuffer();
this.textField.setText("0");
} else if (e.getSource().equals(bt)) {
value=https://www.04ip.com/post/this.textField.getText();
value=https://www.04ip.com/post/value.substring(0,value.length()-1);
if(value.indexOf("-")=0value.length()=1){
value="https://www.04ip.com/post/0";
this.temp=new StringBuffer("");
}else{
this.temp=new StringBuffer(value);
}
this.textField.setText(value);
}else if (e.getSource().equals(bh)) {
value=https://www.04ip.com/post/this.textField.getText();
if(value.indexOf("-")==0){
value=https://www.04ip.com/post/value.substring(1,value.length());
}else{
value="https://www.04ip.com/post/-"+value;
}
this.temp=new StringBuffer(value);
this.textField.setText(value);
推荐阅读
- java怎么变字体代码,java中怎么设置字体大小代码
- cpu开盖什么,cpu开盖什么意思
- 体育游戏的启动信号主要有,引导性体育游戏
- c语言中主函数命令行参数 c语言主函数的形式参数
- pg库查询当天的数据,查询当天的数据sql
- PHP查找数据库中的用户 php7查询数据库
- jquery锚点实例,js锚点定位事件
- 什么直播用蜜号,什么直播用蜜号登录
- linux发短信的命令 linux 短信