Originally posted by Jose Carrillo:
Hi I'm having problems with a program that save the shapes of a paint program this program has three buttons draw line, oval, rect here is my code:
----
public void mouseDragged(MouseEvent mouseevent)
{
mouseX = mouseevent.getX();
mouseY = mouseevent.getY();
showStatus("Mouse is dragged to (" + mouseX + "," + mouseY + ")");
s.setSize(mouseX, mouseY);
shapes.addElement(s);
repaint();
}
----
private int shape;
private Shape s;
private Vector shapes;
----
and having these problems when I compile it:
jcarrill@linux:~/cs201> javac shapes.java
shapes.java:51: cannot resolve symbol
symbol : method setSize (int,int)
location: interface java.awt.Shape
s.setSize(mouseX, mouseY);
^
shapes.java:66: java.awt.Shape is abstract; cannot be instantiated
s = new Shape(shape, mouseX, mouseY);
^
shapes.java:96: cannot resolve symbol
symbol : method draw (java.awt.Graphics)
location: interface java.awt.Shape
((Shape)shapes.elementAt(i)).draw(g);
^
please help I'm fustrated.
The future is here. It's just not evenly distributed yet. - William Gibson
Sonny Gill LinkedIn
Tweets
David Crossett
-nothing important to say, but learnin' plenty-
David Crossett
-nothing important to say, but learnin' plenty-