We hope the following list of questions and answers is helpful. However, if your question isn't answered below, we want to be sure that you get an answer! Check our help page for for times when help is available and information about other sources of on-line help.
You are not obligated to put up a home page.
Solution: remove your old shape from the canvas, add a pristine new Shape, like the one you put in when the object was constructed, and then resize that, negatively if you like.
Color
is built into Java, and this kind of class is what
is needed to color a Line, Rect, Ellipse, etc.
AnyColor
and WebSafeColor
are classes we give you
that have extra features, but you have to study the
API to understand how
they are used. For example, you can do the following:
AnyColor base = new AnyColor(Color.blue); Color lighter = base.desaturate();Note that the desaturate() method returns a Color, not an AnyColor, but you could then turn around and make it an AnyColor by:
base = new AnyColor(lighter);
Emote e = new Emote(0,4,width,height)where width and height are of your choosing.
Complex minPoint
is the current fractal coordiante
of the lower-left point on your screen. Initially (at
constructor time), it is (-2,-2).
Complex fractalDim
is the current dimensions of your
display. Initially it is (4,4).
Let the width and height of your display in pixels be w
.
fractalDim/w
of the fractal plane.
minPoint
minPoint.add(fractalDim)
.
cards
. Also, the lab notes say that you should instantiate
the PictureComponent
for a card only once, returning the same value each
time. Thus, in the setVisible
method of card, you
want to issue a message
setImage
to your PictureComponent
,
passing it the file name of the image that you want to show.
If the card is not visible, then pass it "cards/back.gif"
.
Otherwise, use "cards/"+toString()+".gif"
to pass it the
right filename for this
card.
Card c = new Card(); c.rank = this.rank + 1; // assumes rank is an instance var, private return c;would return a new Card whose rank is one higher than this one's.
A better approach is to offer a private constructor that takes in the required information:
private Card(int rank, int suit) { this.rank = rank; this.suit = suit; }so then you can
return new Card(this.rank+1, this.suit)to accomplish the same thing as I showed above.
You will get full credit for this part if your code
I just replaced the Deck class, so the zip file now has the one from Lab 8.