文档

Java™ 教程-Java Tutorials 中文版
使用几何
Trail: 2D Graphics

课程:使用几何

In prior lessons, you have learned the graphics concept, including basic information about the coordinate system and graphic object creation. Now, you will progress to more detailed lessons about the 2D graphics classes. This lesson shows you how to use the Graphics2D class to draw graphic primitives as well as arbitrary shapes, and how to display graphics with fancy outline and fill styles. These topics are discussed in the following sections.

绘制几何图元

This section explains how to create standard shapes such as points, lines, curves, arcs, rectangles, and ellipses.

绘制任意形状

This section explains how to draw shapes represented by combinations of straight geometric primitives by using the GeneralPath class.

Filling and Stroking

This section explains how to set the stroke and paint attributes to control the outline and fill styles applied to Shape objects and text.


Previous page: Previous Lesson
Next page: Drawing Geometric Primitives