01: // @(#)LocalhostWarning.java 1.5 "@(#)LocalhostWarning.java 1.5 01/05/25 Sun Microsystems"
02:
03: package com.sun.portal.netlet.client.common;
04:
05: import java.awt.*;
06: import java.awt.event.ActionListener;
07:
08: public class LocalhostWarning extends Dialog {
09:
10: private String ntMsg = ResourceProperties.getString("local.1");
11:
12: public LocalhostWarning(Frame f, ActionListener a) {
13: super (f, ResourceProperties.getString("local.2"));
14:
15: TextArea t;
16:
17: GridBagLayout gb = new GridBagLayout();
18: GridBagConstraints gc = new GridBagConstraints();
19:
20: setLayout(gb);
21:
22: gc.fill = GridBagConstraints.NONE;
23: gc.gridwidth = GridBagConstraints.REMAINDER;
24: gc.gridheight = 1;
25: gc.gridx = 0;
26: gc.gridy = 0;
27:
28: t = new TextArea(ntMsg, 20, 80, TextArea.SCROLLBARS_NONE);
29: gc.insets = new Insets(10, 5, 5, 5);
30: gb.setConstraints(t, gc);
31: add(t);
32:
33: gc.gridx = 0;
34: gc.gridy = 1;
35: Button ok = new Button("OK");
36: ok.addActionListener(a);
37:
38: gb.setConstraints(ok, gc);
39: add(ok);
40:
41: pack();
42: Dimension d = Toolkit.getDefaultToolkit().getScreenSize();
43: Point p = new Point();
44: p.x = (d.width / 6);
45: p.y = (d.height / 6);
46: setLocation(p);
47: }
48: }
|