package steptest; import java.awt.*; import java.awt.event.*; import java.applet.*; /** *

タイトル:

*

説明:

*

著作権: Copyright (c) 2003

*

会社名:

* @author 未入力 * @version 1.0 */ public class Applet1 extends Applet { private boolean isStandalone = false; proc proc1; boolean alive=false; public Button stepButton = new Button(); public Button exec = new Button(); public TextField textField1 = new TextField(); public TextField textField2 = new TextField(); //引数値の取得 public String getParameter(String key, String def) { return isStandalone ? System.getProperty(key, def) : (getParameter(key) != null ? getParameter(key) : def); } //アプレットのビルド public Applet1() { } //アプレットの初期化 public void init() { try { jbInit(); } catch(Exception e) { e.printStackTrace(); } } //コンポーネントの初期化 private void jbInit() throws Exception { stepButton.setEnabled(false); stepButton.setLabel("step"); stepButton.setBounds(new Rectangle(150, 158, 75, 27)); stepButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent e) { stepButton_actionPerformed(e); } }); this.setLayout(null); exec.setLabel("exec"); exec.setBounds(new Rectangle(47, 158, 70, 26)); exec.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent e) { exec_actionPerformed(e); } }); textField1.setText("textField1"); textField1.setBounds(new Rectangle(25, 98, 329, 26)); textField2.setText("textField2"); textField2.setBounds(new Rectangle(25, 49, 326, 26)); this.add(textField2, null); this.add(textField1, null); this.add(exec, null); this.add(stepButton, null); } //アプレットの情報取得 public String getAppletInfo() { return "アプレット情報"; } //引数情報の取得 public String[][] getParameterInfo() { return null; } void stepButton_actionPerformed(ActionEvent e) { proc1.step(); //proc1.notify(); } void exec_actionPerformed(ActionEvent e) { if(!alive){ proc1=new proc(this); proc1.start(); alive=true; exec.setLabel("stop"); stepButton.setEnabled(true); } else{ //proc1.stopF=true; proc1.stopproc(); } } }