textArea = new TextArea(5, 40); textArea.setEditable(false); add("Center", textArea); Button button = new Button("Click to bring up dialog"); button.addActionListener(this); Panel panel = new Panel(); panel.add(button); add("South", panel); addWindowListener(this);
if (dialog == null) { dialog = new SimpleDialog(this, "A Simple Dialog"); } dialog.setVisible(true);
DialogWindow window = new DialogWindow(); window.inAnApplet = false; window.setTitle("DialogWindow Application"); window.pack(); window.setVisible(true);
textArea.append(text + "\n");
if (inAnApplet) { dispose(); } else { System.exit(0); }