01: //
02: // Copyright 01/30/01 Sun Microsystems, Inc. All Rights Reserved.
03: //
04: package com.sun.portal.netlet.client.common;
05:
06: import java.awt.*;
07: import java.awt.event.ActionListener;
08:
09: public class ProxyPortDialog extends Dialog {
10:
11: Label port;
12: public Button ok;
13: public TextField pport = new TextField("8080");
14:
15: public ProxyPortDialog(Frame f, ActionListener a) {
16: super (f, ResourceProperties.getString("ppd.1")); // Netlet Proxy Port
17:
18: GridBagLayout gb = new GridBagLayout();
19: GridBagConstraints gc = new GridBagConstraints();
20:
21: setLayout(gb);
22:
23: gc.fill = GridBagConstraints.NONE;
24: gc.gridwidth = GridBagConstraints.REMAINDER;
25: gc.gridheight = 1;
26:
27: gc.gridx = 0;
28: gc.gridy = 0;
29: // Netlet was unable to determine your browser proxy port setting.
30: Label label = new Label(ResourceProperties.getString("ppd.2"),
31: Label.CENTER);
32: gb.setConstraints(label, gc);
33: add(label);
34:
35: gc.gridx = 0;
36: gc.gridy = 1;
37: // Please enter your browser Proxy Port setting below:
38: Label label2 = new Label(ResourceProperties.getString("ppd.3"),
39: Label.CENTER);
40: gb.setConstraints(label2, gc);
41: add(label2);
42:
43: gc.gridx = 0;
44: gc.gridy = 2;
45: Panel pc = new Panel(new FlowLayout(FlowLayout.CENTER, 10, 10));
46: pc.add(pport);
47: gb.setConstraints(pc, gc);
48: add(pc);
49:
50: gc.gridx = 0;
51: gc.gridy = 3;
52: Panel b = new Panel(new FlowLayout(FlowLayout.CENTER, 10, 10));
53:
54: ok = new Button(ResourceProperties.getString("ppd.4")); // OK
55: ok.setActionCommand("OK");
56: ok.addActionListener(a);
57: b.add(ok);
58: Button cancel = new Button(ResourceProperties
59: .getString("ppd.5")); // Cancel
60: cancel.addActionListener(a);
61: b.add(cancel);
62: gb.setConstraints(b, gc);
63: add(b);
64:
65: pack();
66:
67: pport.requestFocus();
68:
69: Dimension d = Toolkit.getDefaultToolkit().getScreenSize();
70: Point pt = new Point();
71: pt.x = (d.width / 6);
72: pt.y = (d.height / 6);
73: setLocation(pt);
74: }
75:
76: public void showWarning() {
77: setVisible(true);
78: toFront();
79: }
80:
81: synchronized public void waitForAction() {
82: try {
83: wait();
84: } catch (InterruptedException e) {
85: }
86: }
87:
88: synchronized public void notifyAction() {
89: notify();
90: }
91:
92: public String getPortText() {
93: return (pport.getText());
94: }
95:
96: }
|