3

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

Can anybody tell me how to do that?

Michael Donohue
  • 11,776
  • 5
  • 31
  • 44
Swati
  • 2,870
  • 7
  • 45
  • 87

1 Answers1

6
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);
Vivart
  • 14,900
  • 6
  • 36
  • 74