Thanks guys,
Andy
I'm really on the verge of giving up. I can't find any good examples
of how to embed mozilla using java. All of the code I find is
fragmented or doesn't work. Any help would be appreciated.
Thanks. I just tried to make a stripped down version using their code
to no avail though. It's giving me errors when trying to add the
progress listener and when trying to call loadURI on the web nav class.
import org.eclipse.swt.SWT;
import org.eclipse.swt.browser.MozillaBrowser;
import org.eclipse.swt.browser.ProgressEvent;
import org.eclipse.swt.browser.ProgressListener;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import org.mozilla.xpcom.nsIDOMDocument;
public class Test {
public static void main(String args[]) {
Display display = new Display();
Shell shell = new Shell(display);
final MozillaBrowser browser = new
MozillaBrowser(shell,WT.BORDER);
browser.setUrl("http://www.google.com");
browser.addProgressListener(new ProgressListener() {
public void changed(ProgressEvent event) {
}
public void completed(ProgressEvent event) {
nsIDOMDocument doc = browser.getDocument();
System.out.println(doc);
}
});
while (!shell.isDisposed()) {
if (!display.readAndDispatch()) {
display.sleep();
}
}
}
scott...@gmail.com escribió:
The browser is inherently a GUI component. However, if the underlying
GUI supports some kind of off-screen or hidden window, then the browser
can probably be made to use that. Under Linux I'm using Xvfb (X virtual
frame buffer server) to run the browser without a real display.
Ben.
--
Ben Hutchings -- b...@decadentplace.org.uk shortened to b...@decadent.org.uk
If you've signed my GPG key, please send a signature on and to the new uid.
I'm not a reverse psychological virus. Please don't copy me into your sig.