aspose file tools*
The moose likes Beginning Java and the fly likes Braincramp regarding classes Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Reply locked New topic
Author

Braincramp regarding classes

David Crossett
Ranch Hand

Joined: Feb 05, 2003
Posts: 102
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 )


David Crossett
-nothing important to say, but learnin' plenty-
Jason Menard
Sheriff

Joined: Nov 09, 2000
Posts: 6450
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 );
David Crossett
Ranch Hand

Joined: Feb 05, 2003
Posts: 102
Moderator please close this thread...I accidentally posted before completing. I reposted above with complete code and questions. Thank you!
Jamie Robertson
Ranch Hand

Joined: Jul 09, 2001
Posts: 1879

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.
David Crossett
Ranch Hand

Joined: Feb 05, 2003
Posts: 102
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!
Jim Yingst
Wanderer
Sheriff

Joined: Jan 30, 2000
Posts: 18671
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.


"I'm not back." - Bill Harding, Twister
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Braincramp regarding classes
 
Similar Threads
Braincramp regarding classes
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