I am working with the Java Swing library. I have two rectangles of the same width and height and the same coordinates. I want to combine them into one so I can get a cross. How can I achieve it?
I am working with the Java Swing library. I have two rectangles of the same width and height and the same coordinates. I want to combine them into one so I can get a cross. How can I achieve it?
Copyright © 2021 Jogjafile Inc.
Construct a
new Area(Shape)of both rectangles, thenarea1.add(area2)(add one to the other).See also the 2D Graphics trail of the tutorial.