- Vaadin 7 UI Design By Example:Beginner’s Guide
- Alejandro Duarte
- 188字
- 2021-08-13 16:17:40
Time for action – adding input component into the layout
Implement your initLayout
method using the following snippet of code:
private void initLayout() {
layout.setMargin(true);
layout.setSpacing(true);
layout.addComponent(combo);
layout.addComponent(textField);
layout.addComponent(checkBox);
layout.addComponent(button);
layout.addComponent(resultsLayout);
setContent(layout);
}
What just happened?
We let the layout to have an appropriate margin and spacing. This last one adds some space between components instead of having them bonded inside the layout. Following that, we add combo
, textField
, checkBox
, button
, and a VerticalLayout
component to put some labels for showing the results of the test case execution. Finally, the last statement sets layout as content of the page.
Checkboxes
Everyone knows checkboxes. Have you ever accepted license agreements during software installations? Just in case, this is a checkbox:

We have already created our checkbox:
private CheckBox checkBox = new CheckBox("Keep previous results");
Note
The getValue
and setValue
methods of CheckBox
return Boolean
objects, no need to cast the returned value as we did with the combo
component. You can do just this:
Boolean checked = checkBox.getValue();
Removing components from layouts
Before explaining how we show the results, let's see how we can execute the selected TestSet
instance.
- 演進式架構(原書第2版)
- ASP.NET MVC4框架揭秘
- 深度學習經典案例解析:基于MATLAB
- 劍指JVM:虛擬機實踐與性能調優
- The Computer Vision Workshop
- 前端架構:從入門到微前端
- Julia Cookbook
- Python機器學習實戰
- OpenStack Orchestration
- Learning Probabilistic Graphical Models in R
- C/C++數據結構與算法速學速用大辭典
- Fast Data Processing with Spark(Second Edition)
- MongoDB Administrator’s Guide
- 網頁設計與制作
- 深入實踐C++模板編程