开发者

Open a website when user clicks on a label field on BlackBerry

开发者 https://www.devze.com 2022-12-21 01:00 出处:网络
I want my BlackBerry app to open a website when I focus on its name. Can anybo开发者_开发知识库dy tell me how to do that?final LabelField label = new LabelField(url,LabelField.FOCUSABLE);

I want my BlackBerry app to open a website when I focus on its name.

Can anybo开发者_开发知识库dy tell me how to do that?


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);
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号