我使用link控件,text的内容是 <a href=\"http://www.google.com\">click me</a>
但是点了以后没有启动浏览器浏览页面,如何才能点击以后启动浏览器浏览页面呢?

解决方案 »

  1.   

    Link link= new Link(contentComposite,SWT.NONE);
    link.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING));
    link.setText("联系方式:<a href=\"http://www.topcheer.com\">链接</a>");
    link.addSelectionListener(new SelectionListener(){ public void widgetSelected(SelectionEvent e) {
    try {
    Runtime.getRuntime().exec("explorer.exe "+e.text);
    } catch (IOException e1) {
    }

    } public void widgetDefaultSelected(SelectionEvent e) {
    // TODO Auto-generated method stub

    }});