sun.applet
Class AppletViewer

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by java.awt.Window
              extended by java.awt.Frame
                  extended by sun.applet.AppletViewer
All Implemented Interfaces:
AppletContext, java.awt.image.ImageObserver, MenuContainer, Serializable

public class AppletViewer
extends Frame
implements AppletContext

The applet viewer makes it possible to run a Java applet without using a browser. For details on the syntax that appletviewer supports, see AppletViewer Tags. (The document named appletviewertags.html in the JDK's docs/tooldocs directory, once the JDK docs have been installed.)

See Also:
Serialized Form

Field Summary
 
Fields inherited from class java.awt.Frame
CROSSHAIR_CURSOR, DEFAULT_CURSOR, E_RESIZE_CURSOR, HAND_CURSOR, MOVE_CURSOR, N_RESIZE_CURSOR, NE_RESIZE_CURSOR, NW_RESIZE_CURSOR, S_RESIZE_CURSOR, SE_RESIZE_CURSOR, SW_RESIZE_CURSOR, TEXT_CURSOR, W_RESIZE_CURSOR, WAIT_CURSOR
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
AppletViewer(int x, int y, URL doc, Hashtable atts, PrintStream statusMsgStream, AppletViewerFactory factory)
          Create the applet viewer
 
Method Summary
 MenuItem addMenuItem(Menu m, String s)
           
protected  void appletQuit()
          Quit all viewers.
static int countApplets()
          How many applets are running?
 Applet getApplet(String name)
          Get an applet by name.
 Enumeration getApplets()
          Return an enumeration of all the accessible applets on this page.
 AudioClip getAudioClip(URL url)
          Get an audio clip.
 java.awt.Image getImage(URL url)
          Get an image.
static void main(String[] argv)
          Deprecated.  
static void networkProperties()
           
static void parse(URL url)
           
static void parse(URL url, PrintStream statusMsgStream, AppletViewerFactory factory)
           
static void parse(URL url, String enc)
          Scan an html file for tags
static void printTag(PrintStream out, Hashtable atts)
          Print the HTML tag.
 void processUserAction(java.awt.event.ActionEvent evt)
          Handle events.
static String scanIdentifier(Reader in)
          Scan identifier
static Hashtable scanTag(Reader in)
          Scan tag
 void showDocument(URL url)
          Ignore.
 void showDocument(URL url, String target)
          Ignore.
 void showStatus(String status)
          Show status.
static void skipSpace(Reader in)
          Scan spaces.
 void updateAtts()
          Make sure the atrributes are uptodate.
 
Methods inherited from class java.awt.Frame
addNotify, dispose, getCursorType, getFrames, getGraphics, getIconImage, getInsets, getMenuBar, getTitle, isResizable, paramString, remove, removeNotify, setCursor, setIconImage, setMenuBar, setResizable, setTitle, validate
 
Methods inherited from class java.awt.Window
addWindowListener, getFocusOwner, getLocale, getToolkit, getWarningString, isShowing, pack, postEvent, processEvent, processWindowEvent, removeWindowListener, repaint, setBackground, setCursor, show, toBack, toFront, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, countComponents, deliverEvent, doLayout, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getLayout, getMaximumSize, getMinimumSize, getPreferredSize, insets, invalidate, isAncestorOf, layout, list, list, locate, minimumSize, paint, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, remove, removeAll, removeContainerListener, setLayout, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addKeyListener, addMouseListener, addMouseMotionListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, getBackground, getBounds, getColorModel, getCursor, getFont, getFontMetrics, getForeground, getLocation, getLocationOnScreen, getName, getParent, getSize, getTreeLock, gotFocus, handleEvent, hide, imageUpdate, inside, isDisplayable, isEnabled, isFocusTraversable, isLightweight, isOpaque, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, removeComponentListener, removeFocusListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, repaint, repaint, repaint, requestFocus, reshape, resize, resize, setBounds, setBounds, setEnabled, setFont, setForeground, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, size, toString, transferFocus
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.awt.MenuContainer
getFont, postEvent
 

Constructor Detail

AppletViewer

public AppletViewer(int x,
                    int y,
                    URL doc,
                    Hashtable atts,
                    PrintStream statusMsgStream,
                    AppletViewerFactory factory)
Create the applet viewer

Method Detail

addMenuItem

public MenuItem addMenuItem(Menu m,
                            String s)

getAudioClip

public AudioClip getAudioClip(URL url)
Get an audio clip.

Specified by:
getAudioClip in interface AppletContext
Parameters:
url - an absolute URL giving the location of the audio clip.
Returns:
the audio clip at the specified URL.

getImage

public java.awt.Image getImage(URL url)
Get an image.

Specified by:
getImage in interface AppletContext
Parameters:
url - an absolute URL giving the location of the image.
Returns:
the image at the specified URL.
See Also:
Image

getApplet

public Applet getApplet(String name)
Get an applet by name.

Specified by:
getApplet in interface AppletContext
Parameters:
name - an applet name.
Returns:
the applet with the given name, or null if not found.

getApplets

public Enumeration getApplets()
Return an enumeration of all the accessible applets on this page.

Specified by:
getApplets in interface AppletContext
Returns:
an enumeration of all applets in the document represented by this applet context.

showDocument

public void showDocument(URL url)
Ignore.

Specified by:
showDocument in interface AppletContext
Parameters:
url - an absolute URL giving the location of the document.

showDocument

public void showDocument(URL url,
                         String target)
Ignore.

Specified by:
showDocument in interface AppletContext
Parameters:
url - an absolute URL giving the location of the document.
target - a String indicating where to display the page.

showStatus

public void showStatus(String status)
Show status.

Specified by:
showStatus in interface AppletContext
Parameters:
status - a string to display in the status window.

printTag

public static void printTag(PrintStream out,
                            Hashtable atts)
Print the HTML tag.


updateAtts

public void updateAtts()
Make sure the atrributes are uptodate.


networkProperties

public static void networkProperties()

appletQuit

protected void appletQuit()
Quit all viewers. Shutdown all viewers properly then exit from the program (if not stand alone)


processUserAction

public void processUserAction(java.awt.event.ActionEvent evt)
Handle events.


countApplets

public static int countApplets()
How many applets are running?


skipSpace

public static void skipSpace(Reader in)
                      throws IOException
Scan spaces.

Throws:
IOException

scanIdentifier

public static String scanIdentifier(Reader in)
                             throws IOException
Scan identifier

Throws:
IOException

scanTag

public static Hashtable scanTag(Reader in)
                         throws IOException
Scan tag

Throws:
IOException

parse

public static void parse(URL url,
                         String enc)
                  throws IOException
Scan an html file for tags

Throws:
IOException

parse

public static void parse(URL url)
                  throws IOException
Throws:
IOException

parse

public static void parse(URL url,
                         PrintStream statusMsgStream,
                         AppletViewerFactory factory)
                  throws IOException
Throws:
IOException

main

public static void main(String[] argv)
Deprecated. 

Old main entry point.