FileDocCategorySizeDatePackage
Message.javaAPI DocExample1625Mon Oct 16 19:44:04 BST 2000None

Message

public class Message extends Applet

Fields Summary
String
message
Color
bg
Color
fg
Font
f
Constructors Summary
Methods Summary
public voidinit()

  message = getParameter("message");
      if( message == null )
      {	message = "No Message";
		}

     	String face = getParameter("typeFace");
      if(face == null)
      {	face = "serif";
		}

      int point;
     	String pointS = getParameter("pointSize");
      if(pointS == null)
      {	point = 12;
		}
		else
		{  point = Integer.parseInt( pointS.trim() );
		}

      f = new Font( face, Font.BOLD, point );

		String fgcS = getParameter( "foreground" );
		if( fgcS == null )
		{  fg = Color.black;
		}
		else
		{  StringTokenizer st = new StringTokenizer( fgcS, "," );
		   int red   = Integer.parseInt(st.nextToken().trim());
		   int green = Integer.parseInt(st.nextToken().trim());
		   int blue  = Integer.parseInt(st.nextToken().trim());
		   fg = new Color( red, green, blue );
		}
	   setForeground( fg );
		
		String bgcS = getParameter( "background" );
		if( bgcS == null )
		{  bg = Color.black;
		}
		else
		{  StringTokenizer st = new StringTokenizer( bgcS, "," );
		   int red   = Integer.parseInt(st.nextToken().trim());
		   int green = Integer.parseInt(st.nextToken().trim());
		   int blue  = Integer.parseInt(st.nextToken().trim());
		   bg = new Color( red, green, blue );
		}
		setBackground( bg );
   
public voidpaint(java.awt.Graphics g)

  g.setFont( f );
   	g.drawString(message, 5, 100 );