well, it would work if you extended a component that already implemented
paint - you can't just call paint without making your class an extension
of one that has the paint method of the graphics object.
Depending on what you are doing, try something like:
Class a extends canvas {
        blah; blah;
}//end of class a
that should "compile"....

does that make sense? I could have been clearer I suppose.

On Fri, 28 Aug 1998, Steve Cohen wrote:

> I realize this may not be the appropriate place for this question but why can't
> I do this?
> 
> //file a:
> 
> import java.awt.*;
> public class a {
>     void paint (Graphics g) {
>         ...
>     }
> 
> }
> 
> //file b:
> import java.awt.*;
> import a;
> 
> public class b {
>     public a A;
>     ...
>     void paint (Graphics g) {
>         A.paint(g);
>     }
> }
> 
> The compilation of file b fails with an error message about an unknown method
> paint( java.awt.Graphics )
> 
> WHY?  This code compiles fine if it is all in one file
> 

Reply via email to