score:1

Accepted answer

this works just fine here on windows 7 using a browser with swt.none:

public static void main(string[] args)
{
    display display = new display();

    final shell shell = new shell(display);
    shell.settext("stackoverflow");
    shell.setlayout(new filllayout());

    browser browser = new browser(shell, swt.none);

    string url = "start.html";
    try
    {
        uri uri = new file(url).touri();
        url urls = uri.tourl();
        browser.seturl(urls.tostring());
    }
    catch (malformedurlexception e)
    {
        e.printstacktrace();
    }

    shell.pack();
    shell.setsize(400, 300);
    shell.open();

    while (!shell.isdisposed())
    {
        if (!display.readanddispatch())
        {
            display.sleep();
        }
    }

    display.dispose();
}

this is the content of the start.html:

<a href="./test.html">click here</a>

and the content of test.html:

<h1>hello</h1>

Related Query

More Query from same tag