1

タブ付きのタブシートがあります。

 TabSheet tabsheet = new TabSheet();
 tabsheet.setSizeUndefined();
 tabsheet.addTab(new Label("Contents of the first tab"),"Слои");
 tabsheet.addTab(table, "Tab");
 tabsheet.addTab(new Label("Contents of the third tab"),"Межевые планы");

ここで、horisontalLayout などの別のコンポーネントを 2 番目のタブに追加したいと考えています。

  HorizontalLayout lo = new HorizontalLayout();
  Button newContact = new Button();
  Button search = new Button();
  Button share = new Button();
  Button help = new Button();
   lo.addComponent(newContact);
   lo.addComponent(search);
   lo.addComponent(share);
   lo.addComponent(help);

しかし、これを行う方法は?

4

2 に答える 2

4

レイアウトを準備します。

    VerticalLayout l1 = new VerticalLayout();
    l1.setMargin(true);
    l1.addComponent(new Label("I am a label."));
    ... add your other components here.

次に、それをタブシートに追加します。

    TabSheet t = new TabSheet();
    t.setHeight("200px");
    t.setWidth("400px");
    t.addTab(l1, "My Tab", icon1);
于 2012-10-03T07:26:14.667 に答える
0

最初にタブ全体のレイアウトを定義する必要があります。その後、このレイアウトに別のコンポーネントを追加できます。以下の例を参照してください。

VerticalLayout verticalLayout = new VerticalLayout();
verticalLayout.setSizeFull();
tabsheet.addTab(verticalLayout, "Vertical Layout with inline components");
verticalLayout.addComponent(new Lable("Example"));
verticalLayout.addComponent(new Button("Button"));
于 2012-10-08T07:07:57.493 に答える