]> gitweb.fperrin.net Git - Dictionary.git/blob - jars/icu4j-4_2_1-src/src/com/ibm/icu/dev/demo/translit/InfoDialog.java
icu4jsrc
[Dictionary.git] / jars / icu4j-4_2_1-src / src / com / ibm / icu / dev / demo / translit / InfoDialog.java
1 /**\r
2  *******************************************************************************\r
3  * Copyright (C) 2001-2007, International Business Machines Corporation and    *\r
4  * others. All Rights Reserved.                                                *\r
5  *******************************************************************************\r
6  */\r
7 package com.ibm.icu.dev.demo.translit;\r
8 import java.awt.event.*;\r
9 import java.awt.*;\r
10 public class InfoDialog extends Dialog {\r
11     /**\r
12      * For serialization\r
13      */\r
14     private static final long serialVersionUID = -3086665546137919018L;\r
15     protected Button button;\r
16     protected TextArea area;\r
17     protected Dialog me;\r
18     protected Panel bottom;\r
19         \r
20     public TextArea getArea() {\r
21         return area;\r
22     }\r
23         \r
24     public Panel getBottom() {\r
25         return bottom;\r
26     }\r
27         \r
28     InfoDialog(Frame parent, String title, String label, String message) {\r
29         super(parent, title, false);\r
30         me = this;\r
31         this.setLayout(new BorderLayout());\r
32         if (label.length() != 0) {\r
33             this.add("North", new Label(label));\r
34         }\r
35             \r
36         area = new TextArea(message, 8, 80, TextArea.SCROLLBARS_VERTICAL_ONLY);\r
37         this.add("Center", area);\r
38             \r
39         button = new Button("Hide");\r
40         button.addActionListener(new ActionListener() {\r
41             public void actionPerformed(ActionEvent e) {\r
42                 me.hide();\r
43             }\r
44         });\r
45         bottom = new Panel();\r
46         bottom.setLayout(new FlowLayout(FlowLayout.CENTER, 0, 0));\r
47         bottom.add(button);\r
48         this.add("South", bottom);\r
49         this.pack();\r
50         addWindowListener(new WindowAdapter() {\r
51             public void windowClosing(WindowEvent e) {\r
52                 me.hide();\r
53             }\r
54         });\r
55     }\r
56 }\r