Given the following example vaading application:
package net.kerba.vaadin7interface;
import com.vaadin.annotations.Theme;
import com.vaadin.annotations.VaadinServletConfiguration;
import com.vaadin.server.VaadinRequest;
import com.vaadin.server.VaadinServlet;
import com.vaadin.shared.ui.label.ContentMode;
import com.vaadin.ui.*;
import javax.servlet.annotation.WebInitParam;
import javax.servlet.annotation.WebServlet;
@Theme("runo")
public class MainUi extends UI {
@Override
protected void init(VaadinRequest request) {
GridLayout main = new GridLayout();
main.setSizeFull();
main.setMargin(false);
Panel panel = new Panel("Working area");
main.addComponent(panel, 0, 0);
panel.setWidth("500px");
panel.setHeight("300px");
panel.setContent(new Label("foobar");", ContentMode.PREFORMATTED));
main.setComponentAlignment(panel, Alignment.MIDDLE_CENTER);
setContent(main);
}
@WebServlet(name = "vaadinServlet",
urlPatterns = {"/app
When I use% for width and height:
panel.setWidth("50%");
panel.setHeight("50%");
I get both scrollbars:

When I use pixels for width and height:
panel.setWidth("500px");
panel.setHeight("300px");
Both scroll bars disappeared:

How can I use% for width and height and make Vaadin not show these scrollbars?
Vaadin 7.1.8
source
share