Handle hostnames with upper-case letters
[webmin.git] / file / ErrorWindow.java
1 import java.awt.*;
2 import java.util.*;
3
4 class ErrorWindow extends FixedFrame implements CbButtonCallback
5 {
6         CbButton ok;
7
8         ErrorWindow(String m)
9         {
10         setLayout(new BorderLayout());
11         Panel cen = new BorderPanel(1);
12         StringTokenizer tok = new StringTokenizer(m, "\r\n");
13         cen.setLayout(new GridLayout(tok.countTokens(), 1));
14         while(tok.hasMoreTokens()) {
15                 cen.add(new Label(tok.nextToken()));
16                 }
17         add("Center", cen);
18         Panel bot = new GrayPanel();
19         bot.setLayout(new FlowLayout(FlowLayout.CENTER));
20         bot.add(new CbButton("Ok", this));
21         add("South", bot);
22         pack();
23         show();
24         setTitle("Error");
25         Util.recursiveBackground(this, Util.body);
26         }
27
28         public void click(CbButton b)
29         {
30         dispose();
31         }
32 }
33
34