FileDocCategorySizeDatePackage
GfxDemo.javaAPI DocExample690Sat Nov 25 12:55:06 GMT 2000None

GfxDemo

public class GfxDemo extends Frame
Graphics Demo for Learning Tree Course 471/478

Fields Summary
int
width
int
height
Constructors Summary
GfxDemo(String s)

		setTitle(s);
		width=400;
		height=300;
		setSize(width, height);
	
GfxDemo(String s, int w, int h)

		setTitle(s);
		setSize(width=w, height=h);	// a short form
	
Methods Summary
public static voidmain(java.lang.String[] a)

		GfxDemo xyz = new GfxDemo("Default Size");
		xyz.setVisible(true);

		new GfxDemo("Smaller", 100,100).setVisible(true);
	
public voidpaint(java.awt.Graphics g)

		g.setColor(Color.red);
		g.fillRect(0, 0, width/2, height/2);
		g.setColor(Color.blue);
		g.drawString("Hello World of Blue", (width/2)+10, (height/2)+10);