请参考以下动作:
//添加文本域
Control control = form.addControl(page, "Text Field0", Field.e_TypeTextField, new RectF(50, 600, 90, 640));
control.getField().setValue("3");
// 更新外观
control.getWidget().resetAppearanceStream();
Control control1 = form.addControl(page, "Text Field1", Field.e_TypeTextField, new RectF(100, 600, 140, 640));
control1.getField().setValue("23");
// 更新外观
control1.getWidget().resetAppearanceStream();
Control control2 = form.addControl(page, "Text Field2", Field.e_TypeTextField, new RectF(150, 600, 190, 640));
Field field2 = control2.getField();
JavaScriptAction javascipt_action = new JavaScriptAction(Action.create(form.getDocument(),
Action.e_TypeJavaScript));
javascipt_action.setScript("AFSimple_Calculate(\"SUM\", new Array (\"Text Field0\", \"Text Field1\"));");
AdditionalAction aa = new AdditionalAction(field2);
aa.setAction(AdditionalAction.e_TriggerFieldRecalculateValue, javascipt_action);
// 更新外观
control2.getWidget().resetAppearanceStream();