gpt4 book ai didi

java - 可滚动的 vaadin View 以显示页面中的所有组件

转载 作者:行者123 更新时间:2023-11-30 06:19:31 25 4
gpt4 key购买 nike

如何使用布局组件在 vaadin 中实现 html 网页(vaadin 新手)

现在无论我在 UI 组件中添加什么组件,只有一些组件出现在浏览器中...

没有滚动选项来查看我在层次结构下方添加的其他组件

public class LoginView extends CustomComponent implements View,
Button.ClickListener {

public static final String NAME = "login";

private TextField user;

private PasswordField password;

private Button loginButton;
NativeSelect select_role;

private HorizontalLayout fieldsBottomPanel;

private VerticalLayout fieldsLeftPanel;

private GridLayout loginPanelGrid;

private VerticalLayout filedsTopPanel;

private VerticalLayout loginFormLayout;

private Label top_header_panel;

private VerticalLayout virtualKeyboard;

private VerticalLayout fieldsRightPanel;

private VerticalLayout footer;

private VerticalLayout header;

private Window page;



public LoginView() {
setSizeFull();
addTopPanelToLoginForm();
addLeftPanelToLoginForm();
addBottomPanelToLoginForm();
addRightPanelToLoginForm();
addLoginFormToPage();
addFooterToPage();
addHeaderToPage();

VerticalLayout viewLayout = new VerticalLayout(header,loginFormLayout,footer);
viewLayout.setComponentAlignment(loginFormLayout,
Alignment.MIDDLE_CENTER);
viewLayout.setStyleName(Reindeer.LAYOUT_WHITE);

setCompositionRoot(viewLayout);
}

public void addHeaderToPage(){
header = new VerticalLayout();
header.setStyleName("header-login");
}


public void addFooterToPage(){
footer = new VerticalLayout();
footer.addStyleName("footer-login");
}
}

最佳答案

您必须将内容放入面板,因为布局不提供滚动条。

[...] if it [Panel] has a fixed or percentual size and its content becomes too big to fit in the content area, a scroll bar will appear for the particular direction. [...]

来自 Vaadin 书籍章节 6.6.1

看看这个线程 here .

关于java - 可滚动的 vaadin View 以显示页面中的所有组件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22987016/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com