You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
606 B
31 lines
606 B
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);
|
|
}
|
|
}
|