Skip to content
Advertisement

Java Inheritance: Paint Program only shows a black screen but doesn’t have any errors

I know its a lot of code but I could really use some help identifying my problem. Thank you!

I am just now being introduced to inheritance and am challenging myself with this application to a painting program. The program is meant to draw different shapes (lines, oval, rectangles, etc.) and I used trial and error to get what I have so far. I no longer am getting errors but the program only shows a black screen. Changing colors doesn’t seem to do anything so I think it has something to do with my color variable.

This is the main class:

JavaScript

This is the the AbstractShapeObject Class:

JavaScript

This is one of the shape classes I coded. All of them have the same format but this one is for drawing an ellipse:

JavaScript

This is the CustomPanel Class (this was provided to us so I don’t think its an error here):

JavaScript

This is the ShapeInterface class (This was also provided):

JavaScript

Advertisement

Answer

I didn’t check all the code, but there is an error in Ellipse class, check my remarks

JavaScript
User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement