mte01
asked on
Drawing a line outside the paint method
Hey Experts!
Well, I guess the question explains itself....In the paint method you can easily draw a line with the Gaphics object g and the method draw line; however, outisde it, if I want to draw a line I can't do that because Graphics is an abstract class, and thus I cannot instantiate objects of its type to draw lines. Is there a simple way to draw a line inside a function?
Well, I guess the question explains itself....In the paint method you can easily draw a line with the Gaphics object g and the method draw line; however, outisde it, if I want to draw a line I can't do that because Graphics is an abstract class, and thus I cannot instantiate objects of its type to draw lines. Is there a simple way to draw a line inside a function?
ASKER
>> Why not call another method with such an object as an argument?
I tried, but I couldn't (you have to instantiate something at some point)...how could you do that??
I tried, but I couldn't (you have to instantiate something at some point)...how could you do that??
I wonder what weird programming you are doing.
What would you instantiate more than you got?
;JOOP!
What would you instantiate more than you got?
;JOOP!
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I didn't understand your last comment.....anyway let's go back to our main point:
>> Why not call another method with such an object as an argument?
How could you do that? and how could that help in drawing a line inside a user function (which is just all what I want to do)
>> Why not call another method with such an object as an argument?
How could you do that? and how could that help in drawing a line inside a user function (which is just all what I want to do)
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
I give up. CEHJ can certainly handle this.
Good night.
;JOOP!
Good night.
;JOOP!
ASKER
Excellant CEHJ that's all what I wanted!
8-)
to a Graphics object. The object is surely "bigger" that the abstract class,
but the abstract class is just a kind of guarantee that some methods
will be implemented. Why not call another method with such an object as an argument?
;JOOP!