Salutations again sir, okay now I get how it is able to detect the wall, what bothers me now is how do I get the rectangle to change its area size

I'v tried to put this code thinking I can chng the rectangle size(in red):

public class collision extends Applet implements Runnable{

[color=red]Dimension area= new Dimension(300,300);[/color]

but somehow when it starts or it runs the window frame is still the same before I modified
(End of first question)

Q2.
and I don't get wat does

this

[color=blue]area=size();[/color]code really mean
why is the size() method have the slash on the word size?-How do I know what the width of the frame or window is so that I know what area.width is wat value

Q3.
U said in order for the mass2 to detect the wall i have to change X[5] rite
(N i managed to get the blue circle to hit the border of the rectangle but had to change the X[5]=area.width-X[4];
to X[5]=area.width+5;)
But how about mass1?
I tried to change X[1] value
and X[4] value but the red circle keeps on bouncing back wen it didn't even hit the wall yet(in this case now I want it to hit the rectangle border)..therefore I plead from u sir could u plz shed some light on this, coz I'm at blur :-\..i know that the division of X[4]by 6 has to with the plot in the frame similar to X[1] but how to make the red circle hit the the border of the rectangle I just don't know ??? It's the reason I asked about the area.width thingyit must have some relation rite?Thx again