HTML Code

<APPLET CODE=AppParams.class WIDTH=500 HEIGHT=100>
  <PARAM NAME=bkcolor VALUE="0000FF">
  <PARAM NAME=textcolor VALUE="AAAA00">
  <PARAM NAME=title VALUE="Lizzie's Playground">
</APPLET>

Java Code

import java.awt.*;
import javax.swing.*;
public class AppParams extends JApplet
{
	JPanel bkgrnd;
	JLabel heading;
	public void init( )
	{
		bkgrnd = new JPanel( );
		bkgrnd.setBackground( new Color( Integer.parseInt( getParameter(  "bkcolor" ), 16 ) ) );
		heading = new JLabel( getParameter( "title" ) );
		heading.setForeground( new Color( Integer.parseInt( getParameter( "textcolor" ), 16 ) ) );
		bkgrnd.add( heading );
		setLayout( new BorderLayout( ) );
		add( bkgrnd, BorderLayout.CENTER );
	}
}

©2007- by E.S.Boese. All Rights Reserved