How to use JRexCanvas directly?
Steve Crook <sc-bPC7Qz6cQG/[email protected]> Mon, 17 Jul 2006 18:40:27 +0100
| Newsgroups | gmane.comp.mozilla.jrex |
|---|---|
| Message-ID | <[email protected]> |
I'm a complete beginner with JRex, and I want to be able to render
HTML/XHTML with a little javascript in a sub-pane as part of my program
(a sub pane in a JSplitPane to be precise). JRex looked a good bet, and
I was prepared to pay the price of the few Mb needed for distribution
because of the quality rendering and Javascript support. JRexCanvas
looked to be the thing to use:
Runtime.getRuntime().traceMethodCalls(true);
JFrame f = new JFrame();
//set the system property "jrex.gre.path" to Mozilla bin directory.
System.setProperty("jrex.gre.path",
"C:/Thirdparty_vs7/java/jrex/jrex_gre");
JRexFactory.getInstance().startEngine();
JRexCanvas jrc = JRexCanvas.createBrowserComponent();
JRexWindowManager winManager =
(JRexWindowManager)JRexFactory.getInstance().getImplInstance(JRexFactory.WINDOW_MANAGER);
winManager.create(JRexWindowManager.INTERNAL_PANE_MODE);
jrc.getNavigator().loadURI("file:///C:/SAF/saf/programs/safadmin/help/HierarchyView.html",
WebNavigationConstants.LOAD_FLAGS_NONE,
null, null, null);
f.pack();
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
f.setVisible(true);
and get this error:
...
org.mozilla.jrex.JRexFactory --->**** getImplInstance()-->key
<WindowManager>
org.mozilla.jrex.window.JRexWindowManagerImpl --->**** create()--> mode<4>
org.mozilla.jrex.navigation.WebNavigationImpl --->**** loadURI
jrexPeer<0> loadFlags<0>
uri<file:///C:/SAF/saf/programs/safadmin/help/HierarchyView.html>postData<null>
headers<null> ****
LoadURI()--> **** juri <0007FA80> loadFlags <0> jrefUri<00000000>
postData<00000000> headers<00000000> ****
LoadURI()--> **** JRexWindow <00000000> ****
******* ThrowJRexException msg <**** LoadURI()-->YOU DO NOT EXIST!!!
****> status <0> *******
******* JRex_ThrowByName nameorg/mozilla/jrex/exception/JRexException
msg **** LoadURI()-->YOU DO NOT EXIST!!! **** [NS-ERROR<0x0L>] *******
org.mozilla.jrex.exception.JRexException: **** LoadURI()-->YOU DO NOT
EXIST!!! **** [NS-ERROR<0x0L>]
at org.mozilla.jrex.navigation.WebNavigationImpl.LoadURI(Native Method)
at
org.mozilla.jrex.navigation.WebNavigationImpl.loadURI(WebNavigationImpl.java:101)
at test.HTMLRenderer.main(HTMLRenderer.java:78)
The HTML does exist. I've looked at the JRex source and can see that
JRexWindowManager.INTERNAL_PANE_MODE doesn't actually do anything, so
I'm wondering if what I want is actually possible...
Steve