Tree - window.drawString("Lab14h - Tree Lab", 50,...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
// A+ Computer Science  -  www.apluscompsci.com  //Name -  //Date -  //Lab  -  import java.awt.Graphics;  import java.awt.Color;  import java.awt.Polygon;  import java.awt.Font;  import java.awt.Canvas;  public class Tree extends Canvas  public Tree()  setBackground(Color.WHITE);  public void paint( Graphics window )  window.setColor(Color.RED);  window.setFont(new Font("TAHOMA",Font.BOLD,12)); 
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: window.drawString("Lab14h - Tree Lab", 50, 50); tree(window); } public void tree(Graphics window) { int treeXPoints = {400,200,600}; int treeYPoints = {100,500,500}; Polygon tree = new Polygon(treeXPoints,treeYPoints,treeXPoints.length); window.setColor(Color.GREEN); window.fillPolygon(tree); } public void star(Graphics window) { } }...
View Full Document

This note was uploaded on 01/24/2011 for the course COMP SCI 543 taught by Professor Mark during the Spring '10 term at Brown College.

Page1 / 2

Tree - window.drawString("Lab14h - Tree Lab", 50,...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online