2 *******************************************************************************
3 * Copyright (C) 2001-2010, International Business Machines Corporation and *
4 * others. All Rights Reserved. *
5 *******************************************************************************
7 package com.ibm.icu.dev.demo.translit;
8 import java.awt.BorderLayout;
9 import java.awt.Button;
10 import java.awt.Dialog;
11 import java.awt.FlowLayout;
12 import java.awt.Frame;
13 import java.awt.Label;
14 import java.awt.Panel;
15 import java.awt.TextArea;
16 import java.awt.event.ActionEvent;
17 import java.awt.event.ActionListener;
18 import java.awt.event.WindowAdapter;
19 import java.awt.event.WindowEvent;
20 public class InfoDialog extends Dialog {
24 private static final long serialVersionUID = -3086665546137919018L;
25 protected Button button;
26 protected TextArea area;
28 protected Panel bottom;
30 public TextArea getArea() {
34 public Panel getBottom() {
38 InfoDialog(Frame parent, String title, String label, String message) {
39 super(parent, title, false);
41 this.setLayout(new BorderLayout());
42 if (label.length() != 0) {
43 this.add("North", new Label(label));
46 area = new TextArea(message, 8, 80, TextArea.SCROLLBARS_VERTICAL_ONLY);
47 this.add("Center", area);
49 button = new Button("Hide");
50 button.addActionListener(new ActionListener() {
51 public void actionPerformed(ActionEvent e) {
56 bottom.setLayout(new FlowLayout(FlowLayout.CENTER, 0, 0));
58 this.add("South", bottom);
60 addWindowListener(new WindowAdapter() {
61 public void windowClosing(WindowEvent e) {