If you’re doing some tests on your Gnome or KDE panels,you may need to reload the panels frequently  for the effect.Instead of restart computer or re-login,reload the process would be a better way.

For ubuntu gnome,press Alt+F2 key combination and type following to kill the process:

killall gnome-panel

reload-panel

It will immediately restart the panels,or you can run gnome-panel to start it.

For ubuntu KDE,also press Alt+F2 key combination and type following

dcop kicker kicker restart

Run following to kill and restart the process if the kicker panel is locked up.

killall kicker

kicker