NullPointerException in HTMLComponent

21 views
Skip to first unread message

g.wo...@bangor.ac.uk

unread,
Sep 12, 2016, 11:24:11 AM9/12/16
to CodenameOne Discussions
If you are experiencing an issue please mention the full platform your issue applies to:
IDE: NetBeans/Eclipse/IDEA Netbeans 8.0.2
Desktop OS Windows
Simulator Latest
Device iPhone

I'm getting the following stacktrace when I use the HTMLComponent. I realise this is deprecated but need to use it for its ability to allow me to have my own DocumentRequestHandler. Looking at the source its suggesting that a font variable is not initialised. Is this a bug or am I using the component incorrectly?

Thanks,
Graham


java.lang.NullPointerException
Rendering frame took too long 563 milliseconds
at com.codename1.ui.html.HTMLComponent.newLine(HTMLComponent.java:1872)
at com.codename1.ui.html.HTMLComponent.newLineIfLastWasNotEmpty(HTMLComponent.java:1931)
at com.codename1.ui.html.HTMLComponent.processTag(HTMLComponent.java:2944)
at com.codename1.ui.html.HTMLComponent.rebuildPage(HTMLComponent.java:1757)
at com.codename1.ui.html.HTMLComponent.documentReady(HTMLComponent.java:1143)
at com.codename1.ui.html.HTMLComponent.streamReady(HTMLComponent.java:1058)
at uk.ac.bangor.sos.cayman.publicapp.SIRENpublic.WebWindow$2.resourceRequestedAsync(WebWindow.java:67)
at com.codename1.ui.html.HTMLComponent.setPage(HTMLComponent.java:982)
at com.codename1.ui.html.HTMLComponent.setPage(HTMLComponent.java:891)
at uk.ac.bangor.sos.cayman.publicapp.SIRENpublic.WebWindow.<init>(WebWindow.java:71)
at uk.ac.bangor.sos.cayman.publicapp.SIRENpublic.WebWindow.showForm(WebWindow.java:36)
at uk.ac.bangor.sos.cayman.publicapp.SIRENpublic.ActMainMenu$2.actionPerformed(ActMainMenu.java:50)
at com.codename1.ui.util.EventDispatcher.fireActionEvent(EventDispatcher.java:349)
at com.codename1.ui.Button.fireActionEvent(Button.java:411)
at com.codename1.ui.Button.released(Button.java:442)
at com.codename1.ui.Button.pointerReleased(Button.java:530)
at com.codename1.ui.Form.pointerReleased(Form.java:2623)
at com.codename1.ui.Form.pointerReleased(Form.java:2559)
at com.codename1.ui.Component.pointerReleased(Component.java:3223)
at com.codename1.ui.Display.handleEvent(Display.java:2022)
at com.codename1.ui.Display.edtLoopImpl(Display.java:1067)
at com.codename1.ui.Display.mainEDTLoop(Display.java:996)
at com.codename1.ui.RunnableWrapper.run(RunnableWrapper.java:120)
at com.codename1.impl.CodenameOneThread.run(CodenameOneThread.java:176)

Shai Almog

unread,
Sep 12, 2016, 11:29:52 PM9/12/16
to CodenameOne Discussions, g.wo...@bangor.ac.uk
I suggest rethinking that approach.
HTMLComponent is deprecated for a very good reason and has been for a while. It has a very good chance of being removed as it's inherently broken.

Shai Almog

unread,
Sep 12, 2016, 11:30:46 PM9/12/16
to CodenameOne Discussions, g.wo...@bangor.ac.uk
FYI most of the advanced functionality can be done thru the JavaScript bridge in the browser component as well as the shouldNavigate API.
Reply all
Reply to author
Forward
0 new messages