by mr hanley 10/31/2014. stddraw is a class developed by princeton university to help novice java...
TRANSCRIPT
![Page 1: By mr Hanley 10/31/2014. StdDraw is a class developed by Princeton University to help novice java programmers interact with a JFrame’s A computer](https://reader035.vdocuments.mx/reader035/viewer/2022071806/56649db05503460f94a9e86a/html5/thumbnails/1.jpg)
USING STDDRAW TO RENDER GRAPHICS
By mr Hanley 10/31/2014
![Page 2: By mr Hanley 10/31/2014. StdDraw is a class developed by Princeton University to help novice java programmers interact with a JFrame’s A computer](https://reader035.vdocuments.mx/reader035/viewer/2022071806/56649db05503460f94a9e86a/html5/thumbnails/2.jpg)
COMPUTER GRAPHICS
StdDraw is a class developed by Princeton University to help novice java programmers interact with a JFrame’s
A computer window uses x and y coordinates to determine where graphics are “painted”
Individual graphics can be drawn using StdDraw. followed by one of the lines or shapes
![Page 3: By mr Hanley 10/31/2014. StdDraw is a class developed by Princeton University to help novice java programmers interact with a JFrame’s A computer](https://reader035.vdocuments.mx/reader035/viewer/2022071806/56649db05503460f94a9e86a/html5/thumbnails/3.jpg)
THE BOUNDARIES AND SCALE
You need to set the bounds and scale of your window
X=0, Y=0
X=width-1, Y=height-1
![Page 4: By mr Hanley 10/31/2014. StdDraw is a class developed by Princeton University to help novice java programmers interact with a JFrame’s A computer](https://reader035.vdocuments.mx/reader035/viewer/2022071806/56649db05503460f94a9e86a/html5/thumbnails/4.jpg)
DRAWING ELEMENTS AND PEN COLOR To change pen color use
StdDraw.setPencolor(Color.black); or Color. And see which options pop up
StdDraw.clear(Color.choose a color) will clear the background to a certain color
StdDraw.show(milliseconds) will show the current scene for 20 milliseconds
![Page 5: By mr Hanley 10/31/2014. StdDraw is a class developed by Princeton University to help novice java programmers interact with a JFrame’s A computer](https://reader035.vdocuments.mx/reader035/viewer/2022071806/56649db05503460f94a9e86a/html5/thumbnails/5.jpg)
GETTING IT SET UP
Search for StdDraw.java from web Copy source to a StdDraw class in your
project Make your program in a separate class You don’t need to make changes to
StdDraw.java file