java - MenuItem in blackberry application -


i use menuitems in application , have question run method override.

private menuitem menuitemupdate = new menuitem("update", 0, 0) {     public void run() {         // can write gui code here?      } }; 

as comment states, can write gui code here? can`t right? since not on gui thread? should use invokelater-method when have code changes gui? , dialogs, should invoked in invokelater-methods well?

and necassary override run-method of menuitem if have made thread invoked when user selects menu item? start thread in constructor instead? , leave run method un-overridden?

you can write ui code there, because ui thread handles user's actions, , calls menu item code. user interaction handled ui thread.


Comments