Draw varying size rectangle with different orientation using rectangle 2D

后端 未结 2 1060
北荒
北荒 2020-12-11 23:40

I want to draw a rectangle in a java application. I have used rectangle2d to draw a rectangle. I need the rectangle to vary size based on mouse drag. i.e. The size of the re

2条回答
  •  星月不相逢
    2020-12-12 00:01

    Check out Custom Painting Approaches for the two common ways to do painting:

    1. from an ArrayList of objects
    2. on a BufferedImage

    The example show how to draw multiple Rectangles of any size and varying colors.

提交回复
热议问题