< prev index next >

src/java.desktop/share/classes/sun/applet/AppletProps.java

Print this page




  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  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 java.security.AccessController;
  32 import java.security.PrivilegedAction;
  33 import java.security.PrivilegedExceptionAction;
  34 import java.security.PrivilegedActionException;
  35 
  36 import sun.security.action.*;
  37 
  38 @SuppressWarnings("serial") // JDK implementation class

  39 class AppletProps extends Frame {
  40 
  41     TextField proxyHost;
  42     TextField proxyPort;
  43     Choice accessMode;
  44 
  45     @SuppressWarnings("deprecation")
  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());


 180         }
 181         if (amh.getMessage("button.reset").equals(obj)) {
 182             reset();
 183             return true;
 184         }
 185         if (amh.getMessage("button.cancel").equals(obj)) {
 186             reset();
 187             hide();
 188             return true;
 189         }
 190         return false;
 191     }
 192 
 193     private static AppletMessageHandler amh = new AppletMessageHandler("appletprops");
 194 
 195 }
 196 
 197 /* 4066432 */
 198 /* Dialog class to display property-related errors to user */
 199 @SuppressWarnings("serial") // JDK implementation class

 200 class AppletPropsErrorDialog extends Dialog {
 201     @SuppressWarnings("deprecation")
 202     public AppletPropsErrorDialog(Frame parent, String title, String message,
 203                 String buttonText) {
 204         super(parent, title, true);
 205         Panel p = new Panel();
 206         add("Center", new Label(message));
 207         p.add(new Button(buttonText));
 208         add("South", p);
 209         pack();
 210 
 211         Dimension dDim = size();
 212         Rectangle fRect = parent.bounds();
 213         move(fRect.x + ((fRect.width - dDim.width) / 2),
 214              fRect.y + ((fRect.height - dDim.height) / 2));
 215     }
 216 
 217     @SuppressWarnings("deprecation")
 218     public boolean action(Event event, Object object) {
 219         hide();


  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  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 java.security.AccessController;
  32 import java.security.PrivilegedAction;
  33 import java.security.PrivilegedExceptionAction;
  34 import java.security.PrivilegedActionException;
  35 
  36 import sun.security.action.*;
  37 
  38 @SuppressWarnings("serial") // JDK implementation class
  39 @Deprecated(since = "9")
  40 class AppletProps extends Frame {
  41 
  42     TextField proxyHost;
  43     TextField proxyPort;
  44     Choice accessMode;
  45 
  46     @SuppressWarnings("deprecation")
  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());


 181         }
 182         if (amh.getMessage("button.reset").equals(obj)) {
 183             reset();
 184             return true;
 185         }
 186         if (amh.getMessage("button.cancel").equals(obj)) {
 187             reset();
 188             hide();
 189             return true;
 190         }
 191         return false;
 192     }
 193 
 194     private static AppletMessageHandler amh = new AppletMessageHandler("appletprops");
 195 
 196 }
 197 
 198 /* 4066432 */
 199 /* Dialog class to display property-related errors to user */
 200 @SuppressWarnings("serial") // JDK implementation class
 201 @Deprecated(since = "9")
 202 class AppletPropsErrorDialog extends Dialog {
 203     @SuppressWarnings("deprecation")
 204     public AppletPropsErrorDialog(Frame parent, String title, String message,
 205                 String buttonText) {
 206         super(parent, title, true);
 207         Panel p = new Panel();
 208         add("Center", new Label(message));
 209         p.add(new Button(buttonText));
 210         add("South", p);
 211         pack();
 212 
 213         Dimension dDim = size();
 214         Rectangle fRect = parent.bounds();
 215         move(fRect.x + ((fRect.width - dDim.width) / 2),
 216              fRect.y + ((fRect.height - dDim.height) / 2));
 217     }
 218 
 219     @SuppressWarnings("deprecation")
 220     public boolean action(Event event, Object object) {
 221         hide();
< prev index next >