I believe many comrades have also thought of their own to write a browser (or a Web page) embedded in their own written form, but the hateful is not provided in the Java class, Java, there is a call Editpane control, can be implemented to open some Web pages, But the CSS and JS effect support is quite poor, so what to do, oh, well, I believe that the comrades who have used SWT should know that SWT is the eclipse development of the jar package, the function is very powerful, including the browser I now want to say, in the presence of SWT that is easy, good, no nonsense, on the code:
Package brower_test_2;
Import Org.eclipse.swt.SWT;
Import Org.eclipse.swt.browser.Browser;
Import Org.eclipse.swt.layout.FillLayout;
Import Org.eclipse.swt.widgets.Display;
Import Org.eclipse.swt.widgets.Shell;
public class Swtbrowseforfund {public
static void Main (string[] args) {
display display = new display ();
Shell shell = new shell (display);
Browser Browser = new Browser (Shell, SWT. NONE);
Browser.seturl ("Http://blog.csdn.net/tangcaijun");
Shell.setlayout (New Filllayout ());
Shell.open ();
while (!shell.isdisposed ())
{
if (Display.readanddispatch ())
{
display.sleep ();
}
}
Display.dispose ();
}
It's so simple, try it yourself ~
Attached jar Download Address: http://download.csdn.net/detail/tangcaijun/5333385
If there is a problem in the process can be posted, I can answer the words will reply as soon as possible