Applet doesnt render HTML page using Cobra

Help
wkt
2011-12-13
2013-04-29
  • wkt
    wkt
    2011-12-13

    I used the following code example from your website :

    Simple Rendering Engine Usage
    A Swing component, HtmlPanel, can render a HTML document, as follows:
    import org.lobobrowser.html.parser.*;
    import org.lobobrowser.html.test.*;
    import org.lobobrowser.html.gui.*;
    import org.lobobrowser.html.*;
    import org.w3c.dom.*;

    HtmlPanel panel = new HtmlPanel();
    // This panel should be added to a JFrame or
    // another Swing component.
    UserAgentcontext ucontext = new SimpleUserAgentContext();
    SimpleHtmlRendererContext rcontext = new SimpleHtmlRendererContext(panel, ucontext);
    // Note that document builder should receive both contexts.
    DocumentBuilderImpl dbi = new DocumentBuilderImpl(ucontext, rcontext);
    // A documentURI should be provided to resolve relative URIs.
    Document document = dbi.parse(new InputSourceImpl(documentReader, documentURI));
    // Now set document in panel. This is what causes the document to render.
    panel.setDocument(document, rcontext);

    The panel I set into a JScrollPane.

    I get :

    http://localhost/HTML/Links/IT/Hardware/20111213Build%20a%20Dollar1000%20Gaming%20PC%20-%20Steps%2013-17.html
    Exception in thread "AWT-EventQueue-2" java.lang.ExceptionInInitializerError
    at org.lobobrowser.html.domimpl.NodeImpl.<clinit>(NodeImpl.java:39)
    at org.lobobrowser.html.parser.DocumentBuilderImpl.createDocument(DocumentBuilderImpl.java:143)
    at org.lobobrowser.html.parser.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:97)
    at wkt.explorernet.wktExplorerApplet.showWebseite(wktExplorerApplet.java:854)
    at wkt.explorernet.wktExplorerApplet$TableRowSelectListener.valueChanged(wktExplorerApplet.java:694)
    at javax.swing.DefaultListSelectionModel.fireValueChanged(Unknown Source)
    at javax.swing.DefaultListSelectionModel.fireValueChanged(Unknown Source)
    at javax.swing.DefaultListSelectionModel.setValueIsAdjusting(Unknown Source)
    at javax.swing.plaf.basic.BasicTableUI$Handler.setValueIsAdjusting(Unknown Source)
    at javax.swing.plaf.basic.BasicTableUI$Handler.mouseReleased(Unknown Source)
    at java.awt.AWTEventMulticaster.mouseReleased(Unknown Source)
    at java.awt.Component.processMouseEvent(Unknown Source)
    at javax.swing.JComponent.processMouseEvent(Unknown Source)
    at java.awt.Component.processEvent(Unknown Source)
    at java.awt.Container.processEvent(Unknown Source)
    at java.awt.Component.dispatchEventImpl(Unknown Source)
    at java.awt.Container.dispatchEventImpl(Unknown Source)
    at java.awt.Component.dispatchEvent(Unknown Source)
    at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
    at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
    at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
    at java.awt.Container.dispatchEventImpl(Unknown Source)
    at java.awt.Component.dispatchEvent(Unknown Source)
    at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
    at java.awt.EventQueue.access$000(Unknown Source)
    at java.awt.EventQueue$1.run(Unknown Source)
    at java.awt.EventQueue$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
    at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
    at java.awt.EventQueue$2.run(Unknown Source)
    at java.awt.EventQueue$2.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
    at java.awt.EventQueue.dispatchEvent(Unknown Source)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
    at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.awt.EventDispatchThread.run(Unknown Source)
    Caused by: java.security.AccessControlException: access denied (java.lang.RuntimePermission accessClassInPackage.sun.font)
    at java.security.AccessControlContext.checkPermission(Unknown Source)
    at java.security.AccessController.checkPermission(Unknown Source)
    at java.lang.SecurityManager.checkPermission(Unknown Source)
    at java.lang.SecurityManager.checkPackageAccess(Unknown Source)
    at sun.plugin2.applet.Applet2SecurityManager.checkPackageAccess(Unknown Source)
    at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.plugin2.applet.Plugin2ClassLoader.loadClass0(Unknown Source)
    at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source)
    at sun.plugin2.applet.Plugin2ClassLoader.loadClass0(Unknown Source)
    at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source)
    at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at org.lobobrowser.util.gui.FontFactory.createFont(FontFactory.java:210)
    at org.lobobrowser.util.gui.FontFactory.createFont_Impl(FontFactory.java:180)
    at org.lobobrowser.util.gui.FontFactory.createFont(FontFactory.java:127)
    at org.lobobrowser.util.gui.FontFactory.getFont(FontFactory.java:98)
    at org.lobobrowser.html.style.StyleSheetRenderState.<clinit>(StyleSheetRenderState.java:43)
    … 41 more