import java.awt.*; import java.awt.event.*; public class DialogTestApplication implements ActionListener { //------------------------------------------------------------------- // DialogTestApplication Constructor //------------------------------------------------------------------- public DialogTestApplication() { Frame window = new Frame("Please enter some text."); TextField tf = new TextField("", 20); tf.addActionListener(this); window.add("South", tf); window.setSize(new Dimension(300,200)); window.setVisible(true); } //------------------------------------------------------------------- // ActionListener interface method //------------------------------------------------------------------- public void actionPerformed(ActionEvent actionEvent) { Object source; source = actionEvent.getSource(); System.out.println("Received event from " + source); String text = ((TextField)source).getText(); DeadLockDialog.popup("What lovely words: " + text); } //------------------------------------------------------------------- // main() entry point //------------------------------------------------------------------- public static void main (String[] args) { new DialogTestApplication(); } } // End of Class DialogTestApplication