Well, you certainly have an interesting project here. Never seen one like it before. Keep up the good work. As for your questions, I have your solutions. Expect any less from the coding ninjas of DIC? So here is the deal...it is pretty simple fix.
In your flower class you have your width and height variables. Did you notice that you never really set the width value? You don't set your height either, at first, but then increment it later. Unfortunately you don't touch your width. So your image is there, but it is 0 pixels in width.

Just to see what I mean, go to your flower class and initialize your
wd variable to something like 100. Then run your app and voila! By the DIC gods you will see your image... unless they don't like you and in that case you won't see it. But, that should fix your disappearing graphic.
Next, your
toString() function is a bit unconventional. Usually the
toString() method doesn't take a parameter and returns the string representation of the object. You would use it any time you want to get the string of what it means to be the flower. You could also use it for things like storing in a List class etc. Your project doesn't currently use the feature but you could build it in with something like in your
Grow() function. Check out a sample below...
CODE
// Grow by the amount expected in one day.
public void grow() {
System.out.println("growing at time " + day);
myFlower.grow();
// Use our toString function to get the dimensions of the flower
System.out.println("Grow message: " + myFlower.toString());
}
So in order to represent your object for instance you could simply use the
toString() listed below...
CODE
// Return a string message showing the height and width of the flower.
public String toString() {
return "The flower's height is " + ht + " and its width is " + wd;
}
So once you fix the width issue and the string issue, you will be on your way.
I did want to point out something else to you. During your growth, when it hits the frost it pretty much kills the height of the flower. I assume you want to grow again right? Well once you hit the frost, your
ht variable no longer seems to grow (because your
growthrate is now 0). Unless you meant to do that, you will want to set that back to 4. This is of course assuming that you are not demonic and want all flowers to die! If you want it to die, by all means, carry on.
Anyways, there you go. Enjoy!
At DIC we be coding ninjas!
This post has been edited by Martyr2: 20 Sep, 2007 - 01:12 PM