views:

58

answers:

1

i am creating an application for blackberry

i want to open a website when i focus on its name

can anybody tell me how can i do that.

thanks in advance!!!!!!!!!!

+3  A: 
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
thank u so much vivart
SWATI