aboutsummaryrefslogtreecommitdiffstats
path: root/sample/rmi/AlertDialog.java
blob: 99fae5c25ade912281994a47d1c11315b3d7aea1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
package sample.rmi;

import java.awt.*;
import java.awt.event.*;

public class AlertDialog extends Frame implements ActionListener {
    private Label label;

    public AlertDialog() {
	super("Alert");
	setSize(200, 100);
	setLocation(100, 100);
	label = new Label();
	Button b = new Button("OK");
	b.addActionListener(this);
	Panel p = new Panel();
	p.add(b);
	add("North", label);
	add("South", p);
    }

    public void show(String message) {
	label.setText(message);
	setVisible(true);
    }

    public void actionPerformed(ActionEvent e) {
	setVisible(false);
    }
}