< prev index next >

src/java.desktop/share/classes/java/applet/Applet.java

Print this page


   1 /*
   2  * Copyright (c) 1995, 2014, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  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


  29 import java.io.IOException;
  30 import java.io.ObjectInputStream;
  31 import java.net.URL;
  32 import java.net.MalformedURLException;
  33 import java.util.Hashtable;
  34 import java.util.Locale;
  35 import javax.accessibility.*;
  36 
  37 /**
  38  * An applet is a small program that is intended not to be run on
  39  * its own, but rather to be embedded inside another application.
  40  * <p>
  41  * The {@code Applet} class must be the superclass of any
  42  * applet that is to be embedded in a Web page or viewed by the Java
  43  * Applet Viewer. The {@code Applet} class provides a standard
  44  * interface between applets and their environment.
  45  *
  46  * @author      Arthur van Hoff
  47  * @author      Chris Warth
  48  * @since       1.0




  49  */


  50 public class Applet extends Panel {
  51 
  52     /**
  53      * Constructs a new Applet.
  54      * <p>
  55      * Note: Many methods in {@code java.applet.Applet}
  56      * may be invoked by the applet only after the applet is
  57      * fully constructed; applet should avoid calling methods
  58      * in {@code java.applet.Applet} in the constructor.
  59      *
  60      * @exception HeadlessException if GraphicsEnvironment.isHeadless()
  61      * returns true.
  62      * @see java.awt.GraphicsEnvironment#isHeadless
  63      * @since 1.4
  64      */
  65     public Applet() throws HeadlessException {
  66         if (GraphicsEnvironment.isHeadless()) {
  67             throw new HeadlessException();
  68         }
  69     }


   1 /*
   2  * Copyright (c) 1995, 2016, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  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


  29 import java.io.IOException;
  30 import java.io.ObjectInputStream;
  31 import java.net.URL;
  32 import java.net.MalformedURLException;
  33 import java.util.Hashtable;
  34 import java.util.Locale;
  35 import javax.accessibility.*;
  36 
  37 /**
  38  * An applet is a small program that is intended not to be run on
  39  * its own, but rather to be embedded inside another application.
  40  * <p>
  41  * The {@code Applet} class must be the superclass of any
  42  * applet that is to be embedded in a Web page or viewed by the Java
  43  * Applet Viewer. The {@code Applet} class provides a standard
  44  * interface between applets and their environment.
  45  *
  46  * @author      Arthur van Hoff
  47  * @author      Chris Warth
  48  * @since       1.0
  49  *
  50  * @deprecated  The Applet API is deprecated. See the
  51  * <a href="package-summary.html"> java.applet package documentation</a>
  52  * for further information.
  53  */
  54 
  55 @Deprecated(since = "9")
  56 public class Applet extends Panel {
  57 
  58     /**
  59      * Constructs a new Applet.
  60      * <p>
  61      * Note: Many methods in {@code java.applet.Applet}
  62      * may be invoked by the applet only after the applet is
  63      * fully constructed; applet should avoid calling methods
  64      * in {@code java.applet.Applet} in the constructor.
  65      *
  66      * @exception HeadlessException if GraphicsEnvironment.isHeadless()
  67      * returns true.
  68      * @see java.awt.GraphicsEnvironment#isHeadless
  69      * @since 1.4
  70      */
  71     public Applet() throws HeadlessException {
  72         if (GraphicsEnvironment.isHeadless()) {
  73             throw new HeadlessException();
  74         }
  75     }


< prev index next >