The best way to integrate a browser into a Java application

I am developing a Java desktop application that will open a web page, allow the user to log in via the web interface and analyze the results of the web server.

So far I can see the implementation of the SWT browser, but it is not supported on the 64-bit version, maybe there is another implementation of browser bindings for Java?

+5
source share
4 answers

Think of using Eclipse as a "Rich Client". You will not have problems using the internal browser that comes with it.

Look here

+3
source

JxBrowser, WebBrowser Chromium Java Swing/JavaFX Windows, Linux Mac OS X. , Browser JFrame:

import com.teamdev.jxbrowser.chromium.Browser;
import com.teamdev.jxbrowser.chromium.swing.BrowserView;

import javax.swing.*;
import java.awt.*;

/**
 * This sample demonstrates how to create Browser instance,
 * embed it into Swing BrowserView container, display it in JFrame and
 * navigate to the "www.google.com" web site.
 */
public class BrowserSample {
    public static void main(String[] args) {
        Browser browser = new Browser();
        BrowserView browserView = new BrowserView(browser);

        JFrame frame = new JFrame();
        frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
        frame.add(browserView, BorderLayout.CENTER);
        frame.setSize(700, 500);
        frame.setLocationRelativeTo(null);
        frame.setVisible(true);

        browser.loadURL("http://www.google.com");
    }
}
0

All Articles