01: /**
02: *******************************************************************************
03: * Copyright (C) 2001-2004, International Business Machines Corporation and *
04: * others. All Rights Reserved. *
05: *******************************************************************************
06: */package com.ibm.icu.dev.demo.translit;
07:
08: import java.awt.event.*;
09: import java.awt.*;
10:
11: public class InfoDialog extends Dialog {
12: protected Button button;
13: protected TextArea area;
14: protected Dialog me;
15: protected Panel bottom;
16:
17: public TextArea getArea() {
18: return area;
19: }
20:
21: public Panel getBottom() {
22: return bottom;
23: }
24:
25: InfoDialog(Frame parent, String title, String label, String message) {
26: super (parent, title, false);
27: me = this ;
28: this .setLayout(new BorderLayout());
29: if (label.length() != 0) {
30: this .add("North", new Label(label));
31: }
32:
33: area = new TextArea(message, 8, 80,
34: TextArea.SCROLLBARS_VERTICAL_ONLY);
35: this .add("Center", area);
36:
37: button = new Button("Hide");
38: button.addActionListener(new ActionListener() {
39: public void actionPerformed(ActionEvent e) {
40: me.hide();
41: }
42: });
43: bottom = new Panel();
44: bottom.setLayout(new FlowLayout(FlowLayout.CENTER, 0, 0));
45: bottom.add(button);
46: this .add("South", bottom);
47: this .pack();
48: addWindowListener(new WindowAdapter() {
49: public void windowClosing(WindowEvent e) {
50: me.hide();
51: }
52: });
53: }
54: }
|