how to remove a component from a panel

i have a table attached to a scrollpane...the scroll pane is attached to the CENTER of a panel that have a borderlayout like this :

JScrollpane sp = new JScrollpane(table);

add(sp, BorderLayout.CENTER);

how to remove the table from the center....i have tried : remove(sp); and then calling revalidate(); but that did not work....

please help....

Thanks in advance

[401 byte] By [bif_fa] at [2007-11-27 5:34:39]
# 1
did you try invalidate() ?
AnanSmritia at 2007-7-12 15:02:53 > top of Java-index,Desktop,Core GUI APIs...
# 2
i did not try it...but i insert a repaint() after the revalidate and it seems to work...thanks a lot
bif_fa at 2007-7-12 15:02:53 > top of Java-index,Desktop,Core GUI APIs...