java.awt.geom


1. Create a Rectangle2D Shape:

import java.awt.geom.Rectangle2D;

Rectangle2D rectangle = new Rectangle2D.Double(10, 10, 100, 50);

2. Create an Ellipse2D Shape:

import java.awt.geom.Ellipse2D;

Ellipse2D ellipse = new Ellipse2D.Double(10, 10, 100, 50);

3. Create a Line2D Shape:

import java.awt.geom.Line2D;

Line2D line = new Line2D.Double(10, 10, 100, 50);

4. Create a Path2D Shape:

import java.awt.geom.Path2D;

Path2D path = new Path2D.Double();

5. Create a RoundRectangle2D Shape:

import java.awt.geom.RoundRectangle2D;

RoundRectangle2D roundedRectangle = new RoundRectangle2D.Double(10, 10, 100, 50, 25, 25);

6. Create a CubicCurve2D Shape:

7. Create a QuadCurve2D Shape:

8. Get the Bounds of a Shape:

9. Translate a Shape:

10. Rotate a Shape:

11. Scale a Shape:

12. Check if a Shape Contains a Point:

13. Check if a Shape Intersects Another Shape:

14. Get the Area of a Shape:

15. Get the Perimeter of a Shape:

16. Draw a Shape:

17. Fill a Shape:

18. Stroke a Shape:

19. Create a PathIterator for a Shape:

20. Create a Transformed Shape:

21. Create a Combined Shape:

22. Create a Difference Shape:

23. Create a Union Shape:

24. Create a Personalized Shape:

25. Create a Star Shape:

26. Create an Arrow Shape:

27. Create a Heart Shape:

28. Create a Leaf Shape:

29. Create a Cloud Shape:

30. Create a Tree Shape:

31. Create a Flower Shape:

32. Create a House Shape:

33. Create a Car Shape:

34. Create a Boat Shape: