Handle hostnames with upper-case letters
[webmin.git] / file / LinedPanel.java
1 import java.awt.*;
2
3 class LinedPanel extends GrayPanel
4 {
5         String title;
6
7         LinedPanel(String t)
8         {
9         title = t;
10         }
11
12         public void paint(Graphics g)
13         {
14         super.paint(g);
15         Font f = g.getFont();
16         FontMetrics fnm = g.getFontMetrics();
17         int w = size().width-1, h = size().height - 1;
18         int tl = fnm.stringWidth(title);
19
20         g.setColor(Util.light_edge);
21         g.drawLine(5, 5, 5, h-5);
22         g.drawLine(5, h-5, w-5, h-5);
23         g.drawLine(w-5, h-5, w-5, 5);
24         g.drawLine(tl+9, 5, w-5, 5);
25
26         g.setColor(Util.dark_edge);
27         g.drawLine(4, 4, 4, h-6);
28         g.drawLine(6, h-6, w-6, h-6);
29         g.drawLine(w-6, h-6, w-6, 6);
30         g.drawLine(w-6, 4, tl+9, 4);
31         g.drawString(title, 7, fnm.getAscent());
32         }
33
34         public Insets insets()
35         {
36         return new Insets(15, 10, 10, 10);
37         }
38 }
39