Vaadin网格布局边框 [英] Vaadin Grid layout borders

查看:51
本文介绍了Vaadin网格布局边框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的 View ( GridLayout )中,我有三种带有很少 TextField 的形式,我需要用黑线边框指定每种形式.我怎样才能做到这一点.我需要包含CSS吗?预先感谢!

I have three form with few TextField in my View (GridLayout), I need to designate each form with black line borders. How Can I do that. Do I need include css? Thanks in advance!

推荐答案

是的,您需要向GridLayout添加样式.

Yes, you need to add a style to the GridLayout.

final GridLayout gridLayout = new GridLayout();
// Add stuff to it ...
gridLayout.addStyleName("your-css-tag");

在主题CSS中(在我的工作区webapp/VAADIN/themes/mytheme/mytheme.scss中):

In your theme css (in my workspace webapp/VAADIN/themes/mytheme/mytheme.scss):

.your-css-tag {
    border-style: solid;
    border-color: black;
    border-width: 1px;
    padding: 5px;
}

您可能需要重新构建项目以合并CSS.在Maven中,这意味着执行 Lifecycle 任务 clean install .

You may need a rebuild of your project, to incorporate the CSS. In Maven, that means executing the Lifecycle tasks clean and install.

有关更多信息,请参见主题上的手册章节.

For more information, see the manual chapter on Themes.

这篇关于Vaadin网格布局边框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆