20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
23 * questions.
24 */
25
26 package sun.applet;
27
28 import java.awt.*;
29 import java.io.*;
30 import java.util.Properties;
31 import sun.net.www.http.HttpClient;
32 import sun.net.ftp.FtpClient;
33 import java.security.AccessController;
34 import java.security.PrivilegedAction;
35 import java.security.PrivilegedExceptionAction;
36 import java.security.PrivilegedActionException;
37
38 import sun.security.action.*;
39
40 class AppletProps extends Frame {
41
42 TextField proxyHost;
43 TextField proxyPort;
44 Choice accessMode;
45
46 AppletProps() {
47 setTitle(amh.getMessage("title"));
48 Panel p = new Panel();
49 p.setLayout(new GridLayout(0, 2));
50
51 p.add(new Label(amh.getMessage("label.http.server", "Http proxy server:")));
52 p.add(proxyHost = new TextField());
53
54 p.add(new Label(amh.getMessage("label.http.proxy")));
55 p.add(proxyPort = new TextField());
56
57 p.add(new Label(amh.getMessage("label.class")));
58 p.add(accessMode = new Choice());
59 accessMode.addItem(amh.getMessage("choice.class.item.restricted"));
177 return true;
178 }
179 if (amh.getMessage("button.reset").equals(obj)) {
180 reset();
181 return true;
182 }
183 if (amh.getMessage("button.cancel").equals(obj)) {
184 reset();
185 hide();
186 return true;
187 }
188 return false;
189 }
190
191 private static AppletMessageHandler amh = new AppletMessageHandler("appletprops");
192
193 }
194
195 /* 4066432 */
196 /* Dialog class to display property-related errors to user */
197
198 class AppletPropsErrorDialog extends Dialog {
199 public AppletPropsErrorDialog(Frame parent, String title, String message,
200 String buttonText) {
201 super(parent, title, true);
202 Panel p = new Panel();
203 add("Center", new Label(message));
204 p.add(new Button(buttonText));
205 add("South", p);
206 pack();
207
208 Dimension dDim = size();
209 Rectangle fRect = parent.bounds();
210 move(fRect.x + ((fRect.width - dDim.width) / 2),
211 fRect.y + ((fRect.height - dDim.height) / 2));
212 }
213
214 public boolean action(Event event, Object object) {
215 hide();
216 dispose();
217 return true;
|
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
23 * questions.
24 */
25
26 package sun.applet;
27
28 import java.awt.*;
29 import java.io.*;
30 import java.util.Properties;
31 import sun.net.www.http.HttpClient;
32 import sun.net.ftp.FtpClient;
33 import java.security.AccessController;
34 import java.security.PrivilegedAction;
35 import java.security.PrivilegedExceptionAction;
36 import java.security.PrivilegedActionException;
37
38 import sun.security.action.*;
39
40 @SuppressWarnings("serial") // JDK implementation class
41 class AppletProps extends Frame {
42
43 TextField proxyHost;
44 TextField proxyPort;
45 Choice accessMode;
46
47 AppletProps() {
48 setTitle(amh.getMessage("title"));
49 Panel p = new Panel();
50 p.setLayout(new GridLayout(0, 2));
51
52 p.add(new Label(amh.getMessage("label.http.server", "Http proxy server:")));
53 p.add(proxyHost = new TextField());
54
55 p.add(new Label(amh.getMessage("label.http.proxy")));
56 p.add(proxyPort = new TextField());
57
58 p.add(new Label(amh.getMessage("label.class")));
59 p.add(accessMode = new Choice());
60 accessMode.addItem(amh.getMessage("choice.class.item.restricted"));
178 return true;
179 }
180 if (amh.getMessage("button.reset").equals(obj)) {
181 reset();
182 return true;
183 }
184 if (amh.getMessage("button.cancel").equals(obj)) {
185 reset();
186 hide();
187 return true;
188 }
189 return false;
190 }
191
192 private static AppletMessageHandler amh = new AppletMessageHandler("appletprops");
193
194 }
195
196 /* 4066432 */
197 /* Dialog class to display property-related errors to user */
198 @SuppressWarnings("serial") // JDK implementation class
199 class AppletPropsErrorDialog extends Dialog {
200 public AppletPropsErrorDialog(Frame parent, String title, String message,
201 String buttonText) {
202 super(parent, title, true);
203 Panel p = new Panel();
204 add("Center", new Label(message));
205 p.add(new Button(buttonText));
206 add("South", p);
207 pack();
208
209 Dimension dDim = size();
210 Rectangle fRect = parent.bounds();
211 move(fRect.x + ((fRect.width - dDim.width) / 2),
212 fRect.y + ((fRect.height - dDim.height) / 2));
213 }
214
215 public boolean action(Event event, Object object) {
216 hide();
217 dispose();
218 return true;
|