Say that the Graphics object grph has a drawing area of width=200 and height=150. Fill in the blanks so that a line is drawn from the lower left corner to the upper right corner of the area.

A good answer might be:

grph.drawLine(  0, 149, 199, 0 )

Since the height is 150, and the numbering of pixels starts at zero, the Y coordinate of the lower left corner is 149.

End of the Chapter

You may wish to review the following. Click on a blue subject that interests you to go to where it was discussed. To get back here, click on the "back arrow" button of your browser.

The next chapter has more examples of applets and graphics.


Click here     Back to the main menu.

You have reached the end of the chapter.