I have a simple question which I cannot find an answer for. In eclipse I have a simple GRect
and GOval
. How can I rotate them 90 degrees clockwise?
I have tried move
and movePolar
but it doesn't have any effect. Here is the code:
import acm.graphics.*;
import acm.program.*;
import java.awt.*;
public class asd extends GraphicsProgram {
public void run() {
double x = (getWidth() - FIGURE_WIDTH) / 2;
double y = (getHeight() - FIGURE_HEIGHT) / 2;
GRect rect = new GRect(x, y, FIGURE_WIDTH, FIGURE_HEIGHT);
rect.setFilled(true);
rect.setColor(Color.RED);
add(rect);
GOval oval = new GOval(x, y, FIGURE_WIDTH, FIGURE_HEIGHT);
oval.setFilled(true);
oval.setFillColor(Color.GREEN);
add(oval);
}
I would like to rotate this 90 degree clockwise.