|
How to combine shapes to draw new shapes |
|
|
This Java tip demonstrates a method of drawing different shapes on a component using combination
of other shapes. The different shapes can be drawn by a developer overwriting the paint() function
of the component.
// Create a new shape
Area shape = new Area(shape1);
// Add shape to shape 2
shape.add(new Area(shape2));
// Subtract shape with shape 3
shape.subtract(new Area(shape3));
shape.intersect(new Area(shape4));
shape.exclusiveOr(new Area(shape5));
|
Related Tips
|
Page 1 of 0 ( 0 comments )
You can share your information about this topic using the form below!
Please do not post your questions with this form! Thanks.