Standalone mode
The Standalone mode lets you launch an Equo Chromium powered browser window directly from Java without using any GUI toolkit (like SWT or Swing). Equo Chromium will automatically create and manage the window for you. This means you can open a web browser in a plain Java app with no UI dependencies. This makes it very easy to show web content without writing any extra code realting to the window.
1. Add the browser import
Import the Equo Chromium ChromiumBrowser
class:
import com.equo.chromium.ChromiumBrowser;
2. Instantiate and create the browser
Call the ChromiumBrowser.standalone(…)
method with your target URL. Then call ChromiumBrowser.startBrowsers()
to start the browser event loop:
public class Standalone {
public static void main(String[] args) {
ChromiumBrowser browser = ChromiumBrowser.standalone(
"https://docs.equo.dev/main/getting-started/introduction.html"
);
ChromiumBrowser.startBrowsers(); //[1]
}
}
[1] This blocks the current thread until you close the browser windows. If you prefer not to block the main thread, you can run with Multithread. Equo Chromium provides a system property to enable its own background message loop. To run with Multithread, please read our Multithread page. With |