SWT toolkit
To use the Equo Chromium widget for the Standard Widget Toolkit (SWT), add the following Java import to your classes:
com.equo.chromium.swt.Browser
There are a few duplicated classes also (com.equo.chromium.swt.OpenWindowListener and com.equo.chromium.swt.WindowEvent) which may require changing the import or using fully qualified names if you see compile errors. |
Using Equo Chromium to Create Web-based UIs
Using and integrating Equo Chromium in your Java application is as simple as adding an import sentence and instantiating the Equo Chromium browser.
First, add the following import sentence to your Java classes:
import com.equo.swt.chromium.Browser;
Then, you just need to create an instance of the Equo Chromium browser:
import com.equo.swt.chromium.Browser;
public class SinglePagePart {
public void createBrowser(Composite parent, String url) {
Browser browser = new Browser(parent, SWT.NONE);
browser.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
browser.setUrl(url);
}
}
Browser Background Color
You must set a background color on the parent composite before calling the browser’s create
method.
For example:
Display display = composite.getDisplay();
Color bgColor = new Color(display, 0, 255, 0);
composite.setBackground(bgColor);
browser = new Browser(composite, SWT.NONE);