aspose file tools*
The moose likes Beginning Java and the fly likes drawRect  method !!! Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "drawRect  method !!!" Watch "drawRect  method !!!" New topic
Author

drawRect method !!!

fatima zohra
Greenhorn

Joined: Mar 11, 2006
Posts: 4
hello everyone

if anyone can help me solve this problem,it would be of great help: " i have to write an applet that allows the iser to input the four arguments required by method draw.Rect, then draw a rectangle using the four input values"

thank you guuuuys
Keith Lynn
Ranch Hand

Joined: Feb 07, 2005
Posts: 2367
How much of it have you written?
fatima zohra
Greenhorn

Joined: Mar 11, 2006
Posts: 4
here is the code i have:

class Rectangle extends Shape {
private int width;
private int height;


Rectangle(int newx, int newy, int newwidth, int newheight) {
super(newx, newy);
setWidth(newwidth);
setHeight(newheight);
}

// accessors for the width & height
int getWidth() { return width; }
int getHeight() { return height; }
void setWidth(int newwidth) { width = newwidth; }
void setHeight(int newheight) { height = newheight; }

// draw the rectangle
void draw() {
System.out.println("Drawing a Rectangle at " + getX() + ", " + getY() +
"), width " + getWidth() + ", height " + getHeight());
}
}
memati bas
Ranch Hand

Joined: Jan 29, 2006
Posts: 85
Try to examine my code.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: drawRect method !!!
 
Similar Threads
Once again .. Passed SCEA Part 1
please help me with this simple...
Customer Order project
How do I use a (boolean?) token to reject user input?
WA #1.....word association