Wow. Thanks for the rapid response!
Doesn’t work. Here is my code:
class MyApp extends Application {
override def init: Unit = {
val mainWindow = new Window("My Application")
val tabsheet = new TabSheet()
val myTabRoot = new VerticalLayout()
myTabRoot.addComponent(
new Label(
"""Cras dictum. Maecenas ut turpis. In vitae erat ac orci dignissim eleifend.
Nunc quis justo. Sed vel ipsum in purus tincidunt pharetra. Sed pulvinar, felis
id consectetuer malesuada, enim nisl mattis elit, a facilisis tortor nibh quis
leo. Sed augue lacus, pretium vitae, molestie eget, rhoncus quis, elit. Donec
in augue. Fusce orci wisi, ornare id, mollis vel, lacinia vel, massa. Pellentesque
habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas."""
)
)
tabsheet.addTab(myTabRoot)
tabsheet.getTab(myTabRoot).setCaption("My Tab")
tabsheet.hideTabs(true)
mainWindow.addComponent(tabsheet)
setMainWindow(mainWindow)
}
}
The above works beautifully, but gives me the ~15px margin.
I have tried (before I posted) setMargin(false), mainWindow.setMargin(false), tabSheet.setMargin(false) – none of them worked. In fact, they won’t compile:
Application.scala:37: not found: value setMargin
Application.scala:37: value setMargin is not a member of com.vaadin.ui.Window
Application.scala:37: value setMargin is not a member of com.vaadin.ui.TabSheet
I read the API and learned that setMargin is a method on Layout, but the API also says that getLayout is deprecated and I should use getContent. But getContent does not return the layout, it returns a ComponentContainer, which is a superclass of Layout, but not a Layout, hence no setMargin method.
Is it just me, or is this way more complicated than it should be? Do I have to explicitly create a layout for my main window and then setMargin on that?
Any ideas?
Chas.ponent(
new Label(