KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > sample > rmi > AlertDialog


1 package sample.rmi;
2
3 import java.awt.*;
4 import java.awt.event.*;
5
6 public class AlertDialog extends Frame implements ActionListener {
7     private Label label;
8
9     public AlertDialog() {
10     super("Alert");
11     setSize(200, 100);
12     setLocation(100, 100);
13     label = new Label();
14     Button b = new Button("OK");
15     b.addActionListener(this);
16     Panel p = new Panel();
17     p.add(b);
18     add("North", label);
19     add("South", p);
20     }
21
22     public void show(String JavaDoc message) {
23     label.setText(message);
24     setVisible(true);
25     }
26
27     public void actionPerformed(ActionEvent e) {
28     setVisible(false);
29     }
30 }
31
Popular Tags