?? apptest.java
字號:
package com.jacob.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 {
/**
* unique identifier added by Eclipse because this class is serializable
*/
private static final long serialVersionUID = -6676420357823607065L;
TextField in;
TextField out;
Button calc;
ActiveXComponent sC = 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");
Dispatch.put(sC, "Language", lang);
}
Variant v = Dispatch.call(sC, "Eval", in.getText());
out.setText(v.toString());
}
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -