This applet draws a collection of round-cornered rectagles over a canvas. The program provides code that allows a user to interact with the rectangles using the mouse. More precisely, a user can click the mouse over any rectangle. The program recognizes the mouse clicks using API methods supported for checking whether a rectangle contains a point. It then uses a bounding box to draw small rectangular box indicating the box that has focus.
General paths are shapes created by using combinations of lines, quadratic curves and cubic curves.
You need to specify the coordinates of the starting, ending and control points of the primitives making up the general path. In Java 2D general paths are represeted by the class GeneralPath. Method exist for creating a path, and testing for edge intersection and point containment. This applet displays eight general path objects ranging from very simple to complex shapes. The applet displays a control panel containing radio buttons for selection of a winding rule and push buttons to control the filling of shapes.