Drawing shapes using java graphics API | Razsoft Education
Shapes in java To draw shape in java, It provides shape interface. Any class that implement the shape interface will be used to draw shapes. To draw shapes we need to pass object of the class which implements the shape interface in the draw() of fill() method of graphics object. Outline of shape is known as path. Java has already a list of class that implement the Shape interface to draw some basic geometrical shapes. Which is defined in to two main category Rectangular shape and non Rectangular shape. We can also implement shape interface in our own class to create custom shapes. Rectangular Shape Rectangular shapes are those shape which Extends the RectangularShape class. The class doesn't define any geometrical shape but it provide a rectangular frame to all the class that extend it. Here is list of some class that extends the RectengularShape class * Rectangle2D * RoundRectangle2D * Arc2D * Ellipse2D Draw and fill To paint any o