Important Notice - Forums is archived
To simplify things and help our users to be more productive, we have archived the current forum and focus our efforts on helping developers on Stack Overflow. You can post new questions on Stack Overflow or join our Discord channel.

Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.
setScrollTop() on Panel class
Hello vaadin users,
I recently have some trouble using the panel class and I need your help.
I have the following code :
ThemeResource file = new ThemeResource("sample.html");
Embedded emb = new Embedded("", file);
emb.setType(Embedded.TYPE_BROWSER);
emb.setWidth("300px");
emb.setHeight("300px");
emb.setSizeUndefined();
panel.setContent(emb);
panel.setScrollTop(100);
addComponent(panel); // add it to a verticalLayout
panel.setHeight(700, Unit.PIXELS);
Could you please tell me why the method panel.setScrollTop(100) doesn't have any effect?
I tried the vaadin book sample with an image and it worked fine.
Thank you for your help,
regards,
Hi think I understand where the problem is. The scroll bar is not the panel's scroll bar but the iframe's scroll bar.
Anyway I've changed this because it was marked as deprecated.
But I still have my problem. My code is now the following :
BrowserFrame browser = new BrowserFrame("", new ThemeResource(fileName));
browser.setWidth("100%");
browser.setHeight("100%");
addComponent(browser);
Is there a way with the class BrowserFrame to scroll programmaticaly over the iframe?
Thank you for your reply,
regards