05-13-2010 10:59 AM
Hi, I wanted to create a Dialog with a timer - I want one of the buttons to show
as time goes along. Is there any way to set the labels of the buttons in a Dialog after it has been created? If not, what would be the easiest way to achieve this? I'm a newbie to BB Fields, Field Managers, etc, so would be glad for some more learned advice.
Thank you very much,
Solved! Go to Solution.
05-13-2010 11:31 AM
My suggestion is to make your own dialog by extending PopupScreen and adding your own ButtonField to it.
Retain a reference to the ButtonField and set the text using ButtonField.setLabel()
Now, assuming that your change of the label will be done from a worker thread or a timer, then you will need to place your setLabel() code in a Runnable, and use UiApplication.invokeLater() to invoke this runnable in the event thread. This is done because you cannot access the UI classes form outside of the event thread.