Resizing the panel heights to avoid vertical scroll bars for the window