< prev index next >

src/java.desktop/share/classes/java/awt/Component.java

Print this page

        

@@ -4028,13 +4028,15 @@
          */
         int height;
 
         /**
          * Creates a new flipping buffer strategy for this component.
-         * The component must be a <code>Canvas</code> or <code>Window</code>.
+         * The component must be a <code>Canvas</code> or <code>Window</code> or
+         * <code>Applet</code>.
          * @see Canvas
          * @see Window
+         * @see Applet
          * @param numBuffers the number of buffers
          * @param caps the capabilities of the buffers
          * @exception AWTException if the capabilities supplied could not be
          * supported or met
          * @exception ClassCastException if the component is not a canvas or

@@ -4047,14 +4049,15 @@
          */
         protected FlipBufferStrategy(int numBuffers, BufferCapabilities caps)
             throws AWTException
         {
             if (!(Component.this instanceof Window) &&
-                !(Component.this instanceof Canvas))
+                !(Component.this instanceof Canvas) &&
+                !(Component.this instanceof Applet))
             {
                 throw new ClassCastException(
-                    "Component must be a Canvas or Window");
+                    "Component must be a Canvas or Window or Applet");
             }
             this.numBuffers = numBuffers;
             this.caps = caps;
             createBuffers(numBuffers, caps);
         }
< prev index next >