6

consider this piece of scala swing code

detail.reactions += {
  case ButtonClicked(but) =>
    detail.contents += new Label(but.text)
    detail.background = new java.awt.Color(0,255,0)
}

the detail is of FlowPanel type. When the button is clicked, the color is instantly repainted, but the Label is not. It gets visible as I click the area. How can I force the detail to repaint its contents after a click?

missingfaktor
  • 90,905
  • 62
  • 285
  • 365
ryskajakub
  • 6,351
  • 8
  • 45
  • 75

1 Answers1

5

In Java, the answer would normally be to call repaint(). Did you try detail.repaint()?

Rex Kerr
  • 166,841
  • 26
  • 322
  • 407