usingMaths.com
Demonstrating and showing pupils and students one application of Mathematics.







<< PreviousNext >>

Graphs like Java Drawing Components




Cartesian Plane

The Cartesian Plane is the usual graph surface we are taught in school.
It consists of the x and y axes.

In Java, drawing is done using the java.awt and/or javax.swing libraries.

With java.awt, drawing is usually done using an Applet or Canvas component.
With javax.swing, drawing is usually done using a JApplet or JPanel component.

Whichever way, there is a subtle difference between the way we use graphs and the Java drawing components:
The y-axis of the Java drawing components is measured from the top and increases as you move downwards.

Graph/Canvas  Comparism


Drawing on the Java Canvas

In Java, the canvas component would represent something like a graph book; and this graph book is plotted or drawn on using code.

Create a new java project; call it Dymetric.
Create a new java class file; call it Facet.
Create a second java class file; call it CanvasFeel.

Type out the adjoining Java algorithm to see what the canvas component feels like.










<< PreviousNext >>