Example usage for java.applet Applet getClass

List of usage examples for java.applet Applet getClass

Introduction

In this page you can find the example usage for java.applet Applet getClass.

Prototype

@HotSpotIntrinsicCandidate
public final native Class<?> getClass();

Source Link

Document

Returns the runtime class of this Object .

Usage

From source file:GetApplets.java

public void printApplets() {
    //Enumeration will contain all applets on this page
    //(including this one) that we can send messages to.
    Enumeration e = getAppletContext().getApplets();

    textArea.append("Results of getApplets():" + newline);

    while (e.hasMoreElements()) {
        Applet applet = (Applet) e.nextElement();
        String info = ((Applet) applet).getAppletInfo();
        if (info != null) {
            textArea.append("- " + info + newline);
        } else {//  ww  w  .  j a  va  2  s  . co  m
            textArea.append("- " + applet.getClass().getName() + newline);
        }
    }
    textArea.append("________________________" + newline + newline);
}

From source file:GetApplets.java

public void printApplets() {
    //Enumeration will contain all applets on this page
    //(including this one) that we can send messages to.
    Enumeration e = getAppletContext().getApplets();

    textArea.append("Results of getApplets():\n");

    while (e.hasMoreElements()) {
        Applet applet = (Applet) e.nextElement();
        String info = ((Applet) applet).getAppletInfo();
        if (info != null) {
            textArea.append("- " + info + "\n");
        } else {/*  w w  w  .  j  a v a2s  . c  o m*/
            textArea.append("- " + applet.getClass().getName() + "\n");
        }
    }
    textArea.append("________________________\n\n");
}

From source file:DummyAppletContext.java

/**
 * Constructor for the main class, given an existing applet object and a default
 * frame (window) width and height./*www.  j  av a 2 s  .c  om*/
 *
 * @param applet            the applet embedded in this AppletContext
 * @param default_width     the default width of the window
 * @param default_height    the default width of the window
 * @param args              the command line arguments.  Contains possibly
 *                          height and width, and any applet parameters
 */
public DummyAppletContext(Applet applet, int default_width, int default_height, String args[]) {

    super(applet.getClass().getName());

    init(applet, default_width, default_height, args, 0);
}