//******************************************************************************
// gramin02.for.java: Applet
//
//******************************************************************************
// |] 4 |\| |\|
import java.applet.*;
import java.awt.*;
public class gramin02 extends Applet
{
int iMaxX,
iMaxY;
String sText;
public gramin02()
{
// TODO: Add constructor code here
}
public String getAppletInfo()
{
return "Name: gramin02\r\n" +
"Author: \r\n" +
"Created with Microsoft Visual J++ Version 6.0";
}
public void init()
{
iMaxX = 255;
iMaxY = 255;
resize( iMaxX, iMaxY );
sText = new String ( "This is a line of Text" );
// TODO: Place additional initialization code here
}
public void paint(Graphics g)
{
//for ( int iY = 0 ; iY < 300 ; iY++ )
//{ for ( int iX = 0 ; iX <300 ; iX++ )
// {
g.setColor ( new Color ( 0, 0, 0 ) );
g.fillRect ( 0, 0, iMaxX, iMaxY );
//Border
for ( int i = 0 ; i < 25 ; i++ )
{
g.setColor ( new Color ( 10*i, 0, 0 ));
g.drawRect ( i, i, iMaxX-i-i-1, iMaxY-i-i-1);
}
//Bottom Right
for ( int i = 0 ; i < 11 ; i++ )
{
g.setColor ( new Color ( 20*i, 0, 0 ));
g.drawString ( sText, 10*i+30, 10*i+125 );
try { Thread.sleep ( 100 ); }
catch ( InterruptedException ex )
{ stop(); }
}
//Top Left
for ( int i = 0 ; i < 11 ; i++ )
{
g.setColor ( new Color ( 20*i, 0, 0 ));
g.drawString ( sText, iMaxX-125-10*i, iMaxY-115-10*i );
try { Thread.sleep ( 50 ); }
catch ( InterruptedException ex )
{ stop(); }
}
g.setColor ( new Color ( 255, 0, 0 ));
g.drawString ( sText, 80, 135 );
}
public void start() { }
public void stop() { }
}