In one of our rcp application's window, I need to set label text dynamically after the creation of the window.
When the window is created I would have created the label control but I would not set the text by then. After user selects a button on the window, I want to set the text of the label inside the button's selection listener method. After setting text to label inside button's selection listener method I am not able to see the text on the window.
Why is that I am not able to see the label text on the window when I set it inside the listener method? Is it because the window is already created?
how do I solve this?
I guess it is something to do with how you layout the label. after setting text on
Label
, do re-layout or adjust its bounds.The Size of the Label is not getting updated after the call to
setText()
. Try callingparent.layout()
aftersetText()
where theparent
is theComposite
containing your label control.