// Shapes2DX3.java
// Demonstrates some Java2D gradient paints and fonts
// APPLET CODE="Shapes2DX3" HEIGHT=500 WIDTH=700
import javax.swing.*;
import java.awt.*;
import java.awt.geom.*;
import java.awt.image.*;

public class Shapes2DX3 extends JApplet {
	private int ballW, ballH;
	private int xPos, yPos;
	private Font f1, f2, f3;

	public void init( ) {
		f1 = new Font( "TimesRoman", Font.BOLD + Font.ITALIC, 148 );
		f2 = new Font( "Courier", Font.PLAIN, 196 );
		f3 = new Font( "Arial", Font.BOLD, 124 );
	}
	
	public void paint( Graphics g ) {
		// create 2D by casting g to Graphics2D
		Graphics2D g2d = ( Graphics2D ) g;

		// create new gradient paints
		GradientPaint bluYel1 = new GradientPaint( 120, 20, Color.blue, 80, 80, Color.yellow, true );
		GradientPaint blkRed1 = new GradientPaint( 130, 5, Color.black, 100, 100, Color.red, true );
		GradientPaint bluYel2 = new GradientPaint( 80, 80, Color.blue, 120, 20, Color.yellow, true );
		GradientPaint blkRed2 = new GradientPaint( 5,130, Color.black, 100, 100, Color.red, true );
		GradientPaint greenBlu1 = new GradientPaint( 1, 1, Color.green, 60, 60, Color.blue, true );

		g2d.setPaint( blkRed1 );
		g2d.setFont( f1 );
		g2d.drawString( "LEHIGH", 35, 147 );
		
		g2d.setPaint( bluYel2 );
//		g2d.setFont( f1 );
//		g2d.setPaint( Color.green );
		g2d.drawString( "LEHIGH", 30, 150 );

		g2d.setPaint( blkRed1 );
		g2d.setFont( f2 );
		g2d.drawString( "Steve", 35, 295 );

		g2d.setPaint( greenBlu1 );
		g2d.setFont( f2 );
		g2d.drawString( "Steve", 30, 300 );

		g2d.setPaint( bluYel1 );
		g2d.setFont( f3 );
		g2d.drawString( "BUELL", 35, 445 );

		g2d.setPaint( blkRed1 );
		g2d.setFont( f3 );
		g2d.drawString( "BUELL", 30, 450 );
	}
}