当我专注于其名称时,我希望我的 BlackBerry 应用程序能够打开一个网站。
谁能告诉我该怎么做?
final LabelField label = new LabelField(url,LabelField.FOCUSABLE);
label.setFocusListener(new FocusChangeListener(){
public void focusChanged(Field field, int eventType) {
if(eventType == FOCUS_GAINED){
BrowserSession bSession = Browser.getDefaultSession();
bSession.displayPage(label.getText());
}
}
});
add(label);