I want to translate a rectangle 2D using a double x and double y. It seems that rectangle2D does not support the translate method. What is the appropriate method to use?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If you need it to remain a Rectangle2D, you might have to write your own custom method that just adds to the x and y.
You can also perform arbitrary transformations with an AffineTransform, but this will turn it into a generic Shape (since that transformation might make it no longer rectangular).