添加上单击事件code到使用labelField [英] Add on-click event code to a LabelField

查看:101
本文介绍了添加上单击事件code到使用labelField的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的应用程序有一个与文本www.google.com使用labelField当用户点击,默认的浏览器应打开www.google.com。

In my application there is a LabelField with text "www.google.com" When the user clicks, the default browser should open to www.google.com.

推荐答案

试试这个code

final LabelField label = new LabelField("http://www.google.com",LabelField.FOCUSABLE){
            public boolean navigationClick (int status , int time){
                 BrowserSession bSession = Browser.getDefaultSession();
                 bSession.displayPage(label.getText());
                 return true;
            }
        };

这篇关于添加上单击事件code到使用labelField的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆