Files
jlibcom/samples/applet/AppTest.java
clay_shooter 43dce6d42f Generated basic javadoc for most methods. Still need some help here
Reformatteda all source using eclipse
eliminated parameters with same names as method variagles
repackaged all tests so that their package names match the directories they are in
merged in Jiffie and Variant EventProxy changes
2005-01-08 17:02:55 +00:00

50 lines
1017 B
Java

package samples.applet;
import java.awt.*;
import java.awt.event.*;
import java.applet.*;
import com.jacob.com.*;
import com.jacob.activeX.*;
/**
* Applet test case
*/
public class AppTest extends Applet implements ActionListener
{
TextField in;
TextField out;
Button calc;
ActiveXComponent sC = null;
Object sControl = null;
/**
* startup method
*/
public void init()
{
setLayout(new FlowLayout());
add(in = new TextField("1+1", 16));
add(out = new TextField("?", 16));
add(calc = new Button("Calculate"));
calc.addActionListener(this);
}
/**
* action method that receives button actions
* @param ev the event
*/
public void actionPerformed(ActionEvent ev)
{
if (sC == null) {
String lang = "VBScript";
sC = new ActiveXComponent("ScriptControl");
sControl = sC.getObject();
Dispatch.put(sControl, "Language", lang);
}
Variant v = Dispatch.call(sControl, "Eval", in.getText());
out.setText(v.toString());
}
}