Thursday, December 15, 2011

Get Applet Context

package org.best.example;

    /*
            Get Applet Context Example
            This java example shows how get applet context object using getAppletContext
            method of Java Applet class.
    */
    
    /*
    <applet code="GetAppletContextExample" width=200 height=200>
    </applet>
    */
    
    
    import java.applet.Applet;
    import java.applet.AppletContext;
    
    public class GetAppletContextExample extends Applet{
    
            public void init(){
                    /*
                     * To get Applet context object use
                     * AppletContext getAppletContext() method.
                     */
                  
                    AppletContext appContext = getAppletContext();
                                  
            }
    }

No comments: