Is there a simple way to open a web page within a GUI\'s JPanel?
If not, how do you open a web page with the computer\'s default web browser?
I am hoping for so
haven't tried it at all, but the cobra HTML parser and viewer from the lobo browser, a browser writen in pure java, may be what you're after. They provide sample code to set up an online html viewer:
import javax.swing.*;
import org.lobobrowser.html.gui.*;
import org.lobobrowser.html.test.*;
public class BareMinimumTest {
public static void main(String[] args) throws Exception {
JFrame window = new JFrame();
HtmlPanel panel = new HtmlPanel();
window.getContentPane().add(panel);
window.setSize(600, 400);
window.setVisible(true);
new SimpleHtmlRendererContext(panel, new SimpleUserAgentContext())
.navigate("http://lobobrowser.org/browser/home.jsp");
}
}