else a=a.divide(tmp,6,BigDecimal.ROUND_HALF_UP);
break;
case '=':break;
}
last_flag=key;
textfield.setText(a.toString());
}
last_in=key;
}
}
/******************************************************************************/
}
}
public static void main(String args[]){
JFrame frm = new JFrame("计算器"); //创建窗体
hello fuck = new hello();
fuck.init();
frm.add("Center",fuck);
frm.pack();
frm.setLocation(250,250);
frm.setSize(200,230);
frm.setResizable(false);
frm.setVisible(true);
}
}
摘自 laoda扯一扯