Forums Register Login

Braincramp regarding classes

+Pie Number of slices to send: Send
I have an abstract class, MyShape, and want to derive a few classes from it - say MyLine, MyRect, and MyOval. MyShape looks a little like this:

Here is sample code for a SIMPLE MyLine object:
[code]
public class MyLine extends MyShape
{
public MyLine() //default constructor
{
super();
}
public MyLine( int x1, int y1, int x2, int y2 ) //regular constructor
{
super( x1, y1, x2, y2 );
}
public void draw( Graphics gg )
+Pie Number of slices to send: Send
I'm not sure what your question is, but you probably want the following in Mfor draw() in MyShape:
public abstract void draw( Graphics gg );
+Pie Number of slices to send: Send
Moderator please close this thread...I accidentally posted before completing. I reposted above with complete code and questions. Thank you!
+Pie Number of slices to send: Send
David
you should be able to close your own topic by clicking on the close link beside the lower Post Reply button and above the "Contact Us" link.
Jamie.
+Pie Number of slices to send: Send
It tells me only Moderators or Admins can do 'this function'.
If anyone is responding to this, PLEASE read this in full in the other thread under the same name!!!
thank you!
+Pie Number of slices to send: Send
Oops, I guess that's not something a regular user can do. You can delete your post, or edit it (which would've worked great here), but not move it. OK. Followup here then.
This is my favorite show. And this is my favorite tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


Reply locked
This thread has been viewed 965 times.
Similar Threads
I need experienced replies only regarding coding standards!
How to make Lines I draw Draggable and Moveable etc??
JFrame application HELP Needed ! ! ! (STILL NEED HELP)
How to make rectangle drawn to be vissible when a new rectangle is drawn
drawing lines with mouse
More...

All times above are in ranch (not your local) time.
The current ranch time is
Apr 15, 2024 22:32:05.