FileDocCategorySizeDatePackage
ColorScribble.javaAPI DocExample2054Mon Sep 22 13:30:30 BST 1997None

ColorScribble

public class ColorScribble extends Scribble
A version of the Scribble applet that reads two applet parameters to set the foreground and background colors. It also returns information about itself when queried.

Fields Summary
private String[]
info
Constructors Summary
Methods Summary
public java.lang.StringgetAppletInfo()

    return "ColorScribble v. 0.02.  Written by David Flanagan.";
  
protected java.awt.ColorgetColorParameter(java.lang.String name)

    String value = this.getParameter(name);
    try { return new Color(Integer.parseInt(value, 16)); }
    catch (Exception e) { return null; }
  
public java.lang.String[][]getParameterInfo()

 return info; 
public voidinit()

    super.init();
    Color foreground = getColorParameter("foreground");
    Color background = getColorParameter("background");
    if (foreground != null) this.setForeground(foreground);
    if (background != null) this.setBackground(background);