beginning_java thread: Thank you Arthur Ore ! Your expertise in Java is greatly appreciated ! !
Dear Arthur Ore,
Aftr making the corrections you suggested, i was for the first time able
to draw all kinds of rectangular shapes with the Sketcher program.
Tremendous feeling ... don't know what to say except YOU ARE THE BEST !!
God bless you
"Arthur Ore" <arthur@j...> wrote:
>I think this these leaves your errors as follows
>SketchView.java": Error #: 300 : method modify(java.awt.Point,
>java.awt.Point) not found in class sketchercalculator.Element at line 103,
>"SketchFrame.java": Error #: 300 : variable elementColor not found in
>sketchercalculator.SketchFrame at line 330, column 19
>"SketchFrame.java": Error #: 300 : variable elementType not
>found in class sketchercalculator.SketchFrame at line 335, column 21
>Let's take the Last two errors first. You have two private variables
> //variable to hold the current element color
> private Color myElementColor = DEFAULT_ELEMENT_COLOR;
> //variable to hold the current element type
> private int myElementTYPE = DEFAULT_ELEMENT_TYPE;
>remove the "my" prefix from the variables and correct the Capitalisation
>"TYPE" and this should fix this problem.
>I found the first error more problematic. At first I thought the error was
>as a result of trying to reference the modify method of the inner class
>which is part of Element, as there is no modiy method in Element itself.
>However, after wracking my very small brain over this, I couldn't work out
>was was going on, so I downloaded the source code from Wrox.
>In fact, what you are missing from the Element class is the method :-
> public abstract void modify(Point start, Point last);
>The moral of this is, that you should really check the sample code
>by Wrox. I'm not aware of the contents of this book, which makes it
>difficult to diagnose some of these problems.
>I've also noticed over a couple of posts that you seem flummoxed if you
>an error message of the type :-
>method methodname(param1, param2, ......) not found in class X
>What this is telling you is one of two things
>1) Either that method is genuinely missing from your class (X)
>2) A method of that name exists in the class, but not with the correct
>number or type of parameters. In this case, you need to check that the
>number and type of parameters where you call the method, match those
>actually defined in the method itself.
>Hope that helps