> Hey,
> Does anybody know of a tutrial or soemthing i can read that would teach
[quoted text clipped - 5 lines]
> would like to teach me or point me to a tutorial it would be greatly
> appreciated.
I think you'll find drawing graphs is pretty simple. A very basic example of
a graph can be seen at
http://java.sun.com/applets/jdk/1.4/demo/applets/SimpleGraph/example1.html.
If you look at the source code (linked below the applet), you'll see that it
is only a very small number of lines of code to draw this sine wave. If you
want to add axes to the graph, that is basically a matter of drawing two
more straight lines via the g.drawLine() method.
If you want to put tick marks on the axes and label the marks, that's a bit
more work but still no big deal: you simply compute the length of the axis
and the range of values you want to show on the axis, then determine where
the tick marks need to be to represent the desired values. For instance, if
the X axis represents 100 units and is 8 cm long and you want tick marks for
the values 25, 50, 75 and 100, you simply put them at 2 cm, 4 cm, 6 cm, and
8 cm from the origin and label appropriately via drawString().
Naturally, you can add as many bells and whistles as you like, such as the
ability to zoom in or out on the graph, show multiple curves, etc. etc.
I think you'll find everything you need in the Graphics and/or Graphics2D
classes in the Java API. Assuming you are using Swing, simply paint the
various lines, curves, and Strings on a JPanel and you should be off to the
races.
--
Rhino
> Hey,
> Does anybody know of a tutrial or soemthing i can read that would teach
[quoted text clipped - 8 lines]
> thanks
> -morc
There is a demo under your JDK install at
..\Java\jdk1.5.0_06\demo\applets\SimpleGraph
So
http://java.sun.com/j2se/1.4.2/docs/api/java/awt/Graphics.html
Examples can be found here in the "The Java Developers Almanac 1.4"
http://www.google.com/custom?num=100&hl=en&lr=&ie=ISO-8859-1&oe=ISO-8859-1&c2cof
f=1&client=pub-6001183370374757&cof=FORID%3A1%3BGL%3A1%3BBGC%3AFFFFFF%3BT%3A%230
00000%3BLC%3A%230000ff%3BVLC%3A%23663399%3BALC%3A%230000ff%3BGALT%3A%23008000%3B
GFNT%3A%230000ff%3BGIMP%3A%230000ff%3BDIV%3A%23336699%3BLBGC%3A336699%3BAH%3Acen
ter%3B&domains=javaalmanac.com&q=Graphics&btnG=Search&sitesearch=javaalmanac.com
Some more info:
http://java.ittoolbox.com/topics/t.asp?t=440&p=440&h1=440
Google is an amazing tool when used..

Signature
Thanks in Advance...
IchBin, Pocono Lake, Pa, USA
http://weconsultants.servebeer.com/JHackerAppManager
__________________________________________________________________________
'If there is one, Knowledge is the "Fountain of Youth"'
-William E. Taylor, Regular Guy (1952-)