Vaadin - Making animation by delaying loop

I’m working in Vaadin 6. In that I have few layouts
(ref this links to understand my layout)
. When I press a button I need to slide the Components in and out. And, I achieved it successfully.

But, My problem is; to make it feel better, I want to slow down the sliding effect. So, It will look like an animation kind of stuff. I’m sliding the Components by changing the setExpandRatio() from 1 to 0.

setExpandRatio(component, 1.0f);

to

setExpandRatio(component, 0f);

So that it will slide.

And to slow down the sliding, I tried this.

float i = 1.0;
while(i >= 0)
{
  setExpandRatio(component, i);
  i = i - 0.1;
  try {
    Thread.sleep(1000);
      } 
    catch(InterruptedException ex) {}
}

It Just waits for 1 second and slides down the component quickly. I also tried using

wait(1000);

But, no use. Has anyone solved this problem before?