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.

TUTORIALVaadin lets you build secure, UX-first PWAs entirely in Java.
Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.
Calling javascript synchronously by Enver Haase, 1 month ago
The problem with the layout
I welcome!
In my case it looks like this -
...
public class MainWindow extends Window {
...
[color=#f61313]setSizeFull();[/color]
...
VerticalLayout mainLayout = new VerticalLayout();
[color=#f61313]mainLayout.setSizeFull();[/color]
...
Panel centerPanel = new Panel();
[color=#f61313]centerPanel.setSizeFull();[/color]
....
mainLayout.addComponent(centerPanel);
mainLayout.setComponentAlignment(centerPanel, Alignment.TOP_CENTER);
...
centerPanel.addComponent(workPanel);
...
workPanel in my case:
...
public Panel buildPanel() {
Panel panel = new Panel();
panel.setStyleName("v-panel-instrumental");
[color=#f61313]panel.setSizeFull();[/color]
HorizontalLayout hl = new HorizontalLayout();
hl.setWidth("100%");
hl.setSpacing(true);
hl.setMargin(true);
hl.setStyleName(Reindeer.LAYOUT_BLUE);
VerticalLayout vl = new VerticalLayout();
vl.setSpacing(false);
vl.setMargin(false);
vl.setStyleName(Reindeer.LAYOUT_BLUE);
AdminUsers adminUsers = new AdminUsers();
Label lh2 = new Label("Администрирование");
lh2.setStyleName(Reindeer.LABEL_H2);
Label lsmall = new Label("Панель режима администратора");
lsmall.setStyleName(Reindeer.LABEL_SMALL);
vl.addComponent(lh2);
vl.addComponent(lsmall);
hl.addComponent(vl);
panel.addComponent(hl);
panel.addComponent(adminUsers);
return panel;
...
..but... --> :glare:
Last updated on
Hi,
I guess the missing step in your quest - is to set the size of the centerPanel's content (a Panel is nothing but a ComponentContainer for ONE component which is ComponentContainer itself, by default it is a VerticalLayout). Calling the following:
centerPanel.getContent().setSizeFull()
Should do the trick.
cheers,
sasha
Last updated on Feb, 2nd 2012
+1
I welcome you, Alexander V Pchelintsev!
..Whew! Yes, it helped, thanks a lot! :D
Last updated on
You cannot reply to this thread.