In my code, the (width,height) of the applet is determined from parameter of the applet.
(You need to specify the width and height values in the applet tag-- Please check out html source for this page.)
area=size(); // get width and height value from applet created by browser. (browser use width/height value in applet tag to allocate area in the browser).
The above area include the area for the button/... at the top.
So I add
to get the real area for the simulation region (exclude the top button/text input...).

Wall in the simulation was drawn with
//draw wall 1,wall2
X4 and X5 is the x value for center of wall 1 and wall 2, and size2 is the width of the wall.
If you want to change the size, you should change 3th/4th parameters.
But you need to change the condition for collision according to the real width of the wall and radius of the circle.
[quote]U said in order for the mass2 to detect the wall i have to change X[5] rite[/quote]
No. What I said was
If you just want to change the wall position, you should change value for x[5] and keep the rest the same.

I am will to help if you have problem with the physics involved.
You need to understand what is the condition to check for collision.
The best way is to write your own code. If you want to follow my code, you will need to understand how it work.