이거 에러나는데 어딜 고쳐야 하는지 가르켜 주세요,
찬솔나라
import java.awt.Graphics;
interface Drawable {
void paint(Graphics g);
}
import java.awt.*;
class DrawableCircle extends Circle implements Drawable {
int x, y;
public DrawableCircle( ) {
this(0, 0, 0);
}
public DrawableCircle(int x, int y, int r) {
super(r);
this.x = x;
this.y = y;
}
public void paint(Graphics g) {
g.drawOval(x-r, y-r, 2*r, 2*r);
g.drawString(String.valueOf(area( )), x - r, y);
}
} import java.awt.*;
class DrawableRectangle extends Rect implements Drawable {
int x, y;
public DrawableRectangle( ) {
this(0, 0, 0);
}
public DrawableRectangle(int x, int y, int w, int h) {
super(w, h);
this.x = x;
this.y = y;
}
public void paint(Graphics g) {
g.drawRect(x, y, width, height);
}
} import java.awt.*;
import javax.swing.*;
public class DrawingFrame extends JFrame {
protected Drawable drawable[ ];
public DrawingFrame( ) {
super(“그림판”);
drawable = new Drawable[3];
drawable[0] = new DrawableCircle(65, 75, 30);
drawable[1] = new DrawableRect(125, 125, 70, 65);
drawable[2] = new DrawableCircle(230, 100, 60);
setDefaultCloseOperation(EXIT_ON_CLOSE);
setSize(400, 300);
setVisible(true);
public void paint(Graphics g) {
int n = drawable.length;
for (int i = 0; i n; i++) {
drawalbe[i].paint(g);
}
}
public static void main(String args[ ]) {
new DrawingFrame( );
}
}
가르켜 주세요,,,
-
어둠
에러 내용을 알려주세요.