</body>
</html>
附录
1.applet代码:
package lqh.rmb.Applicate;
import java.awt.*;
import java.awt.event.*;
import java.applet.*;
import lqh.rmb.*;
public class Rmb extends Applet {
private boolean isStandalone = false;
private RMBConversion rmb=new RMBConversion();
private String var0 = "";
private String re_rmb="";
private String wigth ="0";
private String back_color;
private String fore_color;
public String getParameter(String key, String def) {
return isStandalone ? System.getProperty(key, def) :
(getParameter(key) != null ? getParameter(key) : def);
}
public void paint(Graphics g) {
if(wigth.equals("0")){
wigth = "560";
}
int i= Integer.parseInt(wigth);
if(checkNum(var0)){
if(var0.endsWith(".")){
var0 = var0.substring(0,var0.length()-1);
}
re_rmb= rmb.RMB(var0);
}else{
re_rmb="输入错误:"+var0;
}
int middel =(i - re_rmb.length()*12)/2;
this.setBackground(new Color(getColor(back_color)[0], getColor(back_color)[1], getColor(back_color)[2]));
this.setForeground(new Color(getColor(fore_color)[0], getColor(fore_color)[1], getColor(fore_color)[2]));
g.drawString(re_rmb,middel,20);
}
public void init() {
try {
back_color = this.getParameter("RGB_Back", "241|247|251");
}catch(Exception e) {e.printStackTrace();}
try {
fore_color = this.getParameter("RGB_Fore", "255|0|0");
}catch(Exception e) {e.printStackTrace();}
try {
wigth = this.getParameter("WIGTH", "0");
}catch(Exception e) {e.printStackTrace();}
try {
jbInit();
}catch(Exception e) { e.printStackTrace(); }
}
private void jbInit() throws Exception {
this.setBackground(new Color(getColor(back_color)[0], getColor(back_color)[1], getColor(back_color)[2]));
}
public void setRMB(String rmb_temp){
var0 = r