/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package stackl; /** * * @author suchenek */ import java.applet.*; import java.awt.*; import java.awt.event.*; public class PMapplet extends Applet implements ActionListener { Label // instructionLabel, inputLabel, outputLabel; TextField inputField, outputField; ParenMatcher PM; public void init() { // instructionLabel = new Label(":"); // add(instructionLabel); inputLabel = new Label("Type an expression below and press the Enter key."); add(inputLabel); inputField = new TextField(40); add(inputField); inputField.addActionListener(this); outputLabel = new Label("output:"); add(outputLabel); outputField = new TextField(40); add(outputField); inputField.requestFocus(); PM = new ParenMatcher(); } public void actionPerformed(ActionEvent e){ PM.setInput(e.getActionCommand()); PM.ParenMatch(); outputField.setText(PM.getOutput()); } } // Example of use //$ javac DialogBox.java //$ appletviewer DialogBox.java