problem with : alignment(label -> Alignment.TopCenter) (SCALA)


I have an issue with the place of components : two components (a label and a button) have not the same behavior in terms of alignment.

here is the code:

package com.example.scalatest3

import vaadin.scala._

class Scalatest3Application extends Application("My first app") {

  var label = new Label
  var bouton = new Button

  def buttonClick() {

    label.value = "it rocks a lot!"


  override def main = new VerticalLayout() {

    width_=(100 percent)
    height_=(100 percent)

    label.value = "it rocks"
    alignment(label -> Alignment.TopCenter)

    bouton.caption = "click me!"
    bouton.clickListeners += buttonClick()
    alignment(bouton -> Alignment.TopCenter)



and the result is :
1/ the button stays at the center of the window
2/ the label stays at the top left of the window

none has the expected behaviour


olivier :grin:


Label is in Vaadin (and in Scaladin) by default 100% wide so you have set its width to undefined to get it visually aligned correctly in this case.