Force repaint after button click

Posted by coubeatczech on Stack Overflow See other posts from Stack Overflow or by coubeatczech
Published on 2010-03-22T21:22:30Z Indexed on 2010/03/22 22:21 UTC
Read the original article Hit count: 527

Filed under:
|
|
|

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?

© Stack Overflow or respective owner

Related posts about scala

Related posts about java