Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

How to draw different shapes?

different draw shapes
0
Posted

How to draw different shapes?

0

Question: if i wanted to actually draw the shapes in an applet, would i extend Applet from Shape and then override the paint() method in the Circle, Rectangle classes? Answer: You cannot extend Applet from Shape because applets already extend the Applet class. If you wanted to draw a Shape object, you would probably create a separate applet and draw the shape in the applet; something similar to what we did last week in the Rectangle class. You somehow need the graphics context to draw objects on.

Related Questions

Thanksgiving questions

*Sadly, we had to bring back ads too. Hopefully more targeted.