Full HTML for

Basic foilset Java Programming for Middle and High School Students I: Elementary Java

Given by Nancy McCracken (foils by Tom Scavo) at NPAC/ECS Java Academy on February to April 1998 and 1999. Foils prepared 6 Feb 99
Outside Index Summary of Material


Introduction
Java Applets
Understanding Applet Methods
Elementary Java Graphics
Java Geometry

Table of Contents for full HTML of Java Programming for Middle and High School Students I: Elementary Java

Denote Foils where Image Critical
Denote Foils where Image has important information
Denote Foils where HTML is sufficient
denotes presence of Additional linked information which is greyed out if missing

1 Important URLs for Foil 1 Java Academy
2 Part I: Elementary Java
3 Prerequisites
4 Online Java Resources for Foil 4 Online Java Resources
5 Software for Foil 5 Software
6 Notation
7 Java API Documentation Applications Programming Interface
8 Variable Conventions
9 Java Applets
10 Applets and Applications
11 The HelloWorld Applet My First Applet
12 Class Definition
13 Methods and Arguments
14 Importing Java Classes
15 The HelloWorld Applet HelloWorld.java
16 The Java Compiler
17 HelloWorld.html HelloWorld.html
18 The <APPLET> Tag
19 The <OBJECT> Tag
20 The HelloWorld Applet Viewing the Applet
21 Using the JDK Applet Development Cycle
22 Understanding Applet Methods
23 The java.applet.Applet Class Applet Methods
24 Overriding Applet Methods
25 Applet Life Cycle
26 The java.awt.Container.paint Method The paint Method
27 The AppletDemo Applet Overriding the paint Method
28 Revised Life Cycle
29 The java.awt.Container.update Method The update Method
30 The repaint Method for Foil 30 The repaint Method
31 Clearing the Applet
32 Definition of update
33 Elementary Java Graphics
34 Graphics Concepts
35 Coordinate System
36 Applet Dimensions
37 The java.awt.Graphics Class Graphics Methods
38 The LineTest Applet The drawLine Method
39 The RectTest Applet The drawRect Method
40 The RoundRectTest Applet The drawRoundRect Method
41 The Test3DRect Applet The draw3DRect Method
42 The OvalTest Applet The drawOval Method
43 The ArcTest Applet The drawArc Method
44 Fill Methods
45 Java Geometry
46 The java.awt.Polygon Class The Polygon Class
47 The java.awt.Polygon.addPoint Method The addPoint Method
48 TriangleTest Applet
49 The TriangleTest Applet TriangleTest Applet (cont'd)
50 The TriangleTest2 Exercise An Equilateral Triangle
51 The QuadrilateralTest Applet QuadrilateralTest Applet
52 Another Polygon Constructor
53 The OctagonTest Applet OctagonTest.java
54 The OctagonTest2 Exercise A Regular Octagon
55 HexagonTest Applets for Foil 55 A Surprise!

Outside Index Summary of Material



HTML version of Basic Foils prepared 6 Feb 99

Foil 1 Java Academy

From Java Academy I:Elementary Java NPAC/ECS Java Academy -- February to April 1998 and 1999. *
Full HTML Index Important URLs for Foil 1
Tom Scavo
<trscavo@npac.syr.edu>
NPAC @ SU
111 College Place
Syracuse, NY 13244-4100
Syracuse University
College of Engineering and Computer Science
Northeast Parallel Architectures Center
present

HTML version of Basic Foils prepared 6 Feb 99

Foil 2 Part I: Elementary Java

From Java Academy I:Elementary Java NPAC/ECS Java Academy -- February to April 1998 and 1999. *
Full HTML Index
Introduction
Java Applets
Understanding Applet Methods
Elementary Java Graphics
Java Geometry

HTML version of Basic Foils prepared 6 Feb 99

Foil 3 Prerequisites

From Java Academy I:Elementary Java NPAC/ECS Java Academy -- February to April 1998 and 1999. *
Full HTML Index
A good working knowledge of HTML and the World Wide Web
A high-end PC running Windows 95/NT
A reasonably good network or dialup connection
The following are helpful, but not necessary:
  • programming experience
  • good math background (especially geometry)

HTML version of Basic Foils prepared 6 Feb 99

Foil 4 Online Java Resources

From Java Academy I:Elementary Java NPAC/ECS Java Academy -- February to April 1998 and 1999. *
Full HTML Index Online Java Resources for Foil 4
Java Academy Home Page http://www.npac.syr.edu/projects/k12javaspring98/
NPAC Java Resources http://www.npac.syr.edu/projects/tutorials/Java/
The Java Tutorial http://java.sun.com/tutorial/
Other web sites of interest:

HTML version of Basic Foils prepared 6 Feb 99

Foil 5 Software

From Java Academy I:Elementary Java NPAC/ECS Java Academy -- February to April 1998 and 1999. *
Full HTML Index Software for Foil 5
Sun's Java Development Kit (JDK): http://java.sun.com/products/jdk/
Netscape Communicator with Java 1.1 AWT: http://developer.netscape.com/software/jdk/download.html
Microsoft Internet Explorer: http://www.microsoft.com/ie/download/
JavaEdit by Dick Chase (freeware): http://www.tiac.net/users/dchase/javaedit.htm
TextPad by Helios Software (shareware): http://www.textpad.com/

HTML version of Basic Foils prepared 6 Feb 99

Foil 6 Notation

From Java Academy I:Elementary Java NPAC/ECS Java Academy -- February to April 1998 and 1999. *
Full HTML Index
Code is written in a fixed-width, bold yellow font
Within a code segment, an italicized word denotes a name to be chosen by the programmer
In the text, we often give a method's signature, while omitting the method body. Thus we write: public void paint( Graphics g ); which tells you everything you need to know to use method paint(...), but (intentionally) says nothing about how it is implemented

HTML version of Basic Foils prepared 6 Feb 99

Foil 7 Applications Programming Interface

From Java Academy I:Elementary Java NPAC/ECS Java Academy -- February to April 1998 and 1999. *
Full HTML Index Java API Documentation
A method's signature along with a short description is sometimes referred to as an applications programming interface (API)
Much of the official Java documentation and textbooks use APIs to communicate the Java language
We adopt the same conventions here

HTML version of Basic Foils prepared 6 Feb 99

Foil 8 Variable Conventions

From Java Academy I:Elementary Java NPAC/ECS Java Academy -- February to April 1998 and 1999. *
Full HTML Index
The following variable names are used consistently throughout this document: String s; Graphics g; Font f; FontMetrics fm; Color c; Component c;
In different
sections!

HTML version of Basic Foils prepared 6 Feb 99

Foil 9 Java Applets

From Java Academy I:Elementary Java NPAC/ECS Java Academy -- February to April 1998 and 1999. *
Full HTML Index

HTML version of Basic Foils prepared 6 Feb 99

Foil 10 Applets and Applications

From Java Academy I:Elementary Java NPAC/ECS Java Academy -- February to April 1998 and 1999. *
Full HTML Index
There are two types of Java programs: applets and applications
A Java applet lives on the web and runs inside an ordinary web browser window
A Java application runs on any machine with a Java interpreter installed
In this course, we concentrate on applets...

HTML version of Basic Foils prepared 6 Feb 99

Foil 11 My First Applet

From Java Academy I:Elementary Java NPAC/ECS Java Academy -- February to April 1998 and 1999. *
Full HTML Index The HelloWorld Applet
Our first applet is as simple as can be: // File: HelloWorld.java import java.applet.Applet; import java.awt.Graphics; public class HelloWorld extends Applet { public void paint( Graphics g ) { g.drawString( "Hello World!", 25, 25 ); } }

HTML version of Basic Foils prepared 6 Feb 99

Foil 12 Class Definition

From Java Academy I:Elementary Java NPAC/ECS Java Academy -- February to April 1998 and 1999. *
Full HTML Index
public class HelloWorld extends Applet { ... }

HTML version of Basic Foils prepared 6 Feb 99

Foil 13 Methods and Arguments

From Java Academy I:Elementary Java NPAC/ECS Java Academy -- February to April 1998 and 1999. *
Full HTML Index
public class HelloWorld extends Applet { public void paint( Graphics g ) { g.drawString( "Hello World!", 25, 25 ); } }

HTML version of Basic Foils prepared 6 Feb 99

Foil 14 Importing Java Classes

From Java Academy I:Elementary Java NPAC/ECS Java Academy -- February to April 1998 and 1999. *
Full HTML Index
// File: HelloWorld.java import java.applet.Applet; import java.awt.Graphics;

HTML version of Basic Foils prepared 6 Feb 99

Foil 15 HelloWorld.java

From Java Academy I:Elementary Java NPAC/ECS Java Academy -- February to April 1998 and 1999. *
Full HTML Index The HelloWorld Applet
The complete Java source file: // File: HelloWorld.java import java.applet.Applet; import java.awt.Graphics; public class HelloWorld extends Applet { public void paint( Graphics g ) { g.drawString( "Hello World!", 25, 25 ); } }

HTML version of Basic Foils prepared 6 Feb 99

Foil 16 The Java Compiler

From Java Academy I:Elementary Java NPAC/ECS Java Academy -- February to April 1998 and 1999. *
Full HTML Index
The next step is to compile the source file: > javac HelloWorld.java
The Java compiler (javac) compiles the high-level source code into bytecodes
The file of bytecodes created by the compiler is called "HelloWorld.class"
Note carefully the ".class" extension

HTML version of Basic Foils prepared 6 Feb 99

Foil 17 HelloWorld.html

From Java Academy I:Elementary Java NPAC/ECS Java Academy -- February to April 1998 and 1999. *
Full HTML Index HelloWorld.html
<!-- File: HelloWorld.html --> <HTML> <HEAD> <TITLE>HelloWorld applet</TITLE> </HEAD> <BODY BGCOLOR="#FFFFFF"> <APPLET CODE="HelloWorld.class" WIDTH=150 HEIGHT=50> </APPLET> </BODY> </HTML>

HTML version of Basic Foils prepared 6 Feb 99

Foil 18 The <APPLET> Tag

From Java Academy I:Elementary Java NPAC/ECS Java Academy -- February to April 1998 and 1999. *
Full HTML Index
The most important part of the HTML file is the <APPLET> tag: <APPLET CODE="HelloWorld.class" WIDTH=150 HEIGHT=50> </APPLET> which loads the bytecodes into the browser
Note that the "applet window" is specified to be 150 pixels wide and 50 pixels high

HTML version of Basic Foils prepared 6 Feb 99

Foil 19 The <OBJECT> Tag

From Java Academy I:Elementary Java NPAC/ECS Java Academy -- February to April 1998 and 1999. *
Full HTML Index
In HTML 4.0, the <APPLET> tag has been deprecated in favor of the more general <OBJECT> tag : <OBJECT CLASSID="HelloWorld.class" CODETYPE="application/java" WIDTH=150 HEIGHT=50> </OBJECT>
The above <OBJECT> tag is equivalent to the <APPLET> tag on the previous foil

HTML version of Basic Foils prepared 6 Feb 99

Foil 20 Viewing the Applet

From Java Academy I:Elementary Java NPAC/ECS Java Academy -- February to April 1998 and 1999. *
Full HTML Index The HelloWorld Applet
Once the source file has been compiled and the HTML file has been created, the applet may be viewed: > appletviewer HelloWorld.html
Alternatively, you may view the applet with a Java-enabled browser such as Netscape Communicator or Microsoft Internet Explorer

HTML version of Basic Foils prepared 6 Feb 99

Foil 21 Applet Development Cycle

From Java Academy I:Elementary Java NPAC/ECS Java Academy -- February to April 1998 and 1999. *
Full HTML Index Using the JDK

HTML version of Basic Foils prepared 6 Feb 99

Foil 22 Understanding Applet Methods

From Java Academy I:Elementary Java NPAC/ECS Java Academy -- February to April 1998 and 1999. *
Full HTML Index

HTML version of Basic Foils prepared 6 Feb 99

Foil 23 Applet Methods

From Java Academy I:Elementary Java NPAC/ECS Java Academy -- February to April 1998 and 1999. *
Full HTML Index The java.applet.Applet Class
The following methods are invoked automatically by the Java interpreter: public void init(); public void start(); public void stop(); public void destroy();
Initially, these methods of the Applet class all have empty bodies, but...

HTML version of Basic Foils prepared 6 Feb 99

Foil 24 Overriding Applet Methods

From Java Academy I:Elementary Java NPAC/ECS Java Academy -- February to April 1998 and 1999. *
Full HTML Index
An applet may override any or all of these methods, like this: import java.applet.Applet; public class AppletDemo extends Applet { public void init() { /* insert code */ } public void start() { /* insert code */ } public void stop() { /* insert code */ } public void destroy() { /* insert code */ } }

HTML version of Basic Foils prepared 6 Feb 99

Foil 25 Applet Life Cycle

From Java Academy I:Elementary Java NPAC/ECS Java Academy -- February to April 1998 and 1999. *
Full HTML Index
init() and destroy() are called once and only once during the life of the applet
start() and stop() are called repeatedly

HTML version of Basic Foils prepared 6 Feb 99

Foil 26 The paint Method

From Java Academy I:Elementary Java NPAC/ECS Java Academy -- February to April 1998 and 1999. *
Full HTML Index The java.awt.Container.paint Method
Other methods are called automatically by the Java interpreter, for instance: public void paint( Graphics g );
The paint(...) method is called immediately after start() and any time the applet window must be redrawn
Like the others, paint(...) can (and should) be overridden by the programmer

HTML version of Basic Foils prepared 6 Feb 99

Foil 27 Overriding the paint Method

From Java Academy I:Elementary Java NPAC/ECS Java Academy -- February to April 1998 and 1999. *
Full HTML Index The AppletDemo Applet
Override the paint(...) method like this: import java.applet.Applet; import java.awt.Graphics; public class AppletDemo extends Applet { public void init() { /* insert code */ } public void start() { /* insert code */ } public void stop() { /* insert code */ } public void destroy() { /* insert code */ } public void paint( Graphics g ) { // insert code here } }

HTML version of Basic Foils prepared 6 Feb 99

Foil 28 Revised Life Cycle

From Java Academy I:Elementary Java NPAC/ECS Java Academy -- February to April 1998 and 1999. *
Full HTML Index
Like start() and stop(), the paint(...) method will be called by Java many times during the life of an applet

HTML version of Basic Foils prepared 6 Feb 99

Foil 29 The update Method

From Java Academy I:Elementary Java NPAC/ECS Java Academy -- February to April 1998 and 1999. *
Full HTML Index The java.awt.Container.update Method
All of the methods in the previous diagram are called automatically by the Java VM
What if the programmer wants to repaint the applet explicitly?
In that case, call the update(...) method: public void update( Graphics g );
The update(...) method simply clears the applet window and calls paint(...)

HTML version of Basic Foils prepared 6 Feb 99

Foil 30 The repaint Method

From Java Academy I:Elementary Java NPAC/ECS Java Academy -- February to April 1998 and 1999. *
Full HTML Index The repaint Method for Foil 30
Note, however, that update(...) takes a Graphics argument, which is inconvenient
Instead, call the repaint() method: public void repaint(); which in turn calls update(...)
Note: The repaint() method is almost never overridden by the programmer

HTML version of Basic Foils prepared 6 Feb 99

Foil 31 Clearing the Applet

From Java Academy I:Elementary Java NPAC/ECS Java Academy -- February to April 1998 and 1999. *
Full HTML Index
Let's examine update(...) more closely...
Given a Graphics object g, the following code fragment clears the applet window: int w = getSize().width; int h = getSize().height; g.setColor( getBackground() ); g.fillRect( 0, 0, w, h ); g.setColor( getForeground() );

HTML version of Basic Foils prepared 6 Feb 99

Foil 32 Definition of update

From Java Academy I:Elementary Java NPAC/ECS Java Academy -- February to April 1998 and 1999. *
Full HTML Index
So here is update(...) in its entirety: public void update( Graphics g ) { // clear the applet and call paint: int w = getSize().width; int h = getSize().height; g.setColor( getBackground() ); g.fillRect( 0, 0, w, h ); g.setColor( getForeground() ); paint( g ); }

HTML version of Basic Foils prepared 6 Feb 99

Foil 33 Elementary Java Graphics

From Java Academy I:Elementary Java NPAC/ECS Java Academy -- February to April 1998 and 1999. *
Full HTML Index

HTML version of Basic Foils prepared 6 Feb 99

Foil 34 Graphics Concepts

From Java Academy I:Elementary Java NPAC/ECS Java Academy -- February to April 1998 and 1999. *
Full HTML Index
Think of a Java applet as a graphics window on which to draw text and other objects
The graphics window has a particular width and height as specified in the <APPLET> tag
The origin is in the top left-hand corner of the graphics window: the x-coordinate increases from left to right, while the y-coordinate increases from top to bottom

HTML version of Basic Foils prepared 6 Feb 99

Foil 35 Coordinate System

From Java Academy I:Elementary Java NPAC/ECS Java Academy -- February to April 1998 and 1999. *
Full HTML Index

HTML version of Basic Foils prepared 6 Feb 99

Foil 36 Applet Dimensions

From Java Academy I:Elementary Java NPAC/ECS Java Academy -- February to April 1998 and 1999. *
Full HTML Index
In Java, the width and height of the applet are obtained as follows: int width = getSize().width; int height = getSize().height;
These are the same width and height given in the <APPLET> tag: <APPLET ... WIDTH=... HEIGHT=... >
Note: All measurements are in pixels

HTML version of Basic Foils prepared 6 Feb 99

Foil 37 Graphics Methods

From Java Academy I:Elementary Java NPAC/ECS Java Academy -- February to April 1998 and 1999. *
Full HTML Index The java.awt.Graphics Class
drawLine(...)
drawRect(...)
drawRoundRect(...)
draw3DRect(...)
drawOval(...)
drawArc(...)
drawString(...)
fillRect(...)
fillRoundRect(...)
fill3DRect(...)
fillOval(...)
fillArc(...)
Important methods from the Graphics class:

HTML version of Basic Foils prepared 6 Feb 99

Foil 38 The drawLine Method

From Java Academy I:Elementary Java NPAC/ECS Java Academy -- February to April 1998 and 1999. *
Full HTML Index The LineTest Applet
The drawLine(...) method draws a line segment with endpoints (x1,y1) and (x2,y2): public void drawLine( int x1, int y1, int x2, int y2 );

HTML version of Basic Foils prepared 6 Feb 99

Foil 39 The drawRect Method

From Java Academy I:Elementary Java NPAC/ECS Java Academy -- February to April 1998 and 1999. *
Full HTML Index The RectTest Applet
The drawRect(...) method draws a rectangle anchored at point (x,y): public void drawRect( int x, int y, int w, int h );

HTML version of Basic Foils prepared 6 Feb 99

Foil 40 The drawRoundRect Method

From Java Academy I:Elementary Java NPAC/ECS Java Academy -- February to April 1998 and 1999. *
Full HTML Index The RoundRectTest Applet
The drawRoundRect(...) method draws a rectangle with rounded corners: public void drawRoundRect( int x, int y, int w, int h, int W, int H );

HTML version of Basic Foils prepared 6 Feb 99

Foil 41 The draw3DRect Method

From Java Academy I:Elementary Java NPAC/ECS Java Academy -- February to April 1998 and 1999. *
Full HTML Index The Test3DRect Applet
The draw3DRect(...) method draws a 3-d rectangle anchored at point (x,y): public void draw3DRect( int x, int y, int w, int h, boolean raised );

HTML version of Basic Foils prepared 6 Feb 99

Foil 42 The drawOval Method

From Java Academy I:Elementary Java NPAC/ECS Java Academy -- February to April 1998 and 1999. *
Full HTML Index The OvalTest Applet
The drawOval(...) method draws an ellipse anchored at point (x,y): public void drawOval( int x, int y, int w, int h );

HTML version of Basic Foils prepared 6 Feb 99

Foil 43 The drawArc Method

From Java Academy I:Elementary Java NPAC/ECS Java Academy -- February to April 1998 and 1999. *
Full HTML Index The ArcTest Applet
The drawArc(...) method draws an arc anchored at point (x,y): public void drawArc( int x, int y, int w, int h, int t1, int t2 );

HTML version of Basic Foils prepared 6 Feb 99

Foil 44 Fill Methods

From Java Academy I:Elementary Java NPAC/ECS Java Academy -- February to April 1998 and 1999. *
Full HTML Index
Each "draw" method (except drawLine and drawString) has a corresponding "fill" method
The syntax is the same except that the word "draw" is replaced by "fill" (e.g., fillRect)
An object is filled with the current color, chosen as follows: g.setColor( c ); where c is a Color object

HTML version of Basic Foils prepared 6 Feb 99

Foil 45 Java Geometry

From Java Academy I:Elementary Java NPAC/ECS Java Academy -- February to April 1998 and 1999. *
Full HTML Index

HTML version of Basic Foils prepared 6 Feb 99

Foil 46 The Polygon Class

From Java Academy I:Elementary Java NPAC/ECS Java Academy -- February to April 1998 and 1999. *
Full HTML Index The java.awt.Polygon Class
The java.awt.Polygon class is used to represent arbitrary polygons: Polygon p = new Polygon(); p.addPoint( 50, 25 ); p.addPoint( 75, 100 ); p.addPoint( 25, 100 );
The above triangle is drawn like this: g.drawPolygon( p );

HTML version of Basic Foils prepared 6 Feb 99

Foil 47 The addPoint Method

From Java Academy I:Elementary Java NPAC/ECS Java Academy -- February to April 1998 and 1999. *
Full HTML Index The java.awt.Polygon.addPoint Method
Each call to the addPoint(...) method adds a vertex to the polygon
When the drawPolygon(...) method is called, the last vertex is automatically joined with the first (except in Java 1.0, which has a permanent bug)
There is a corresponding fillPolygon(...) method, of course

HTML version of Basic Foils prepared 6 Feb 99

Foil 48 TriangleTest Applet

From Java Academy I:Elementary Java NPAC/ECS Java Academy -- February to April 1998 and 1999. *
Full HTML Index
Our test applet creates two triangles: p1 = new Polygon(); p1.addPoint( 50, 25 ); p1.addPoint( 75, 100 ); p1.addPoint( 25, 100 ); p2 = new Polygon(); p2.addPoint( 125, 25 ); p2.addPoint( 175, 100 ); p2.addPoint( 125, 100 );

HTML version of Basic Foils prepared 6 Feb 99

Foil 49 TriangleTest Applet (cont'd)

From Java Academy I:Elementary Java NPAC/ECS Java Academy -- February to April 1998 and 1999. *
Full HTML Index The TriangleTest Applet
The test applet draws one triangle and fills the other: public void paint( Graphics g ) { g.drawPolygon( p1 ); g.fillPolygon( p2 ); }
In the exercises, you are asked to draw an equilateral triangle...

HTML version of Basic Foils prepared 6 Feb 99

Foil 50 An Equilateral Triangle

From Java Academy I:Elementary Java NPAC/ECS Java Academy -- February to April 1998 and 1999. *
Full HTML Index The TriangleTest2 Exercise
An equilateral triangle has three sides of equal length
To draw an equilateral triangle precisely, we must determine its height h

HTML version of Basic Foils prepared 6 Feb 99

Foil 51 QuadrilateralTest Applet

From Java Academy I:Elementary Java NPAC/ECS Java Academy -- February to April 1998 and 1999. *
Full HTML Index The QuadrilateralTest Applet
Our next test applet draws two quadrilaterals, for example: p = new Polygon(); p.addPoint( 25, 25 ); p.addPoint( 125, 25 ); p.addPoint( 125, 75 ); p.addPoint( 25, 75 );
There's another way to do it, however...

HTML version of Basic Foils prepared 6 Feb 99

Foil 52 Another Polygon Constructor

From Java Academy I:Elementary Java NPAC/ECS Java Academy -- February to April 1998 and 1999. *
Full HTML Index
Here's another way to instantiate a polygon: int xValues = { 25, 125, 125, 25 }; int yValues = { 25, 25, 75, 75 }; Polygon p = new Polygon( xValues, yValues, 4 );
To fill this quadrilateral, type: g.fillPolygon( p );
Note: The number of vertices is required in this version of the Polygon constructor

HTML version of Basic Foils prepared 6 Feb 99

Foil 53 OctagonTest.java

From Java Academy I:Elementary Java NPAC/ECS Java Academy -- February to April 1998 and 1999. *
Full HTML Index The OctagonTest Applet
Our next test applet draws an octagon inside a square
It does this by trisecting each side of the square
This octagon is not regular, however...

HTML version of Basic Foils prepared 6 Feb 99

Foil 54 A Regular Octagon

From Java Academy I:Elementary Java NPAC/ECS Java Academy -- February to April 1998 and 1999. *
Full HTML Index The OctagonTest2 Exercise
A regular octagon has all sides equal
Solve for y in terms of x:
x
x
y
y
x

HTML version of Basic Foils prepared 6 Feb 99

Foil 55 A Surprise!

From Java Academy I:Elementary Java NPAC/ECS Java Academy -- February to April 1998 and 1999. *
Full HTML Index HexagonTest Applets for Foil 55
Our final test applet draws a hexagon inside a square
All sides of the hexagon are equal, but this hexagon is not regular!
We leave it to you to figure this out...

© Northeast Parallel Architectures Center, Syracuse University, npac@npac.syr.edu

If you have any comments about this server, send e-mail to webmaster@npac.syr.edu.

Page produced by wwwfoil on Sat Feb 6 1999