We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpSyntax Questions › why isnt working online
Page Index Toggle Pages: 1
why isnt working online? (Read 1373 times)
why isnt working online?
Feb 1st, 2010, 9:15am
 
i cant find why while it is runs ok localy, online it isnt
i would be really greatful if u could help

http://kerkyra.ionio.gr/~av200640/processing/
Re: why isnt working online?
Reply #1 - Feb 1st, 2010, 9:44am
 
"A null PFont was passed to textFont()"

Did you put the font in the data subdirectory?
Re: why isnt working online?
Reply #2 - Feb 1st, 2010, 9:45am
 
the java console for my browser (firefox) says:

Caused by: java.lang.RuntimeException: A null PFont was passed to textFont()
...
     at _1_2_10_8_final_for_web.show(_1_2_10_8_final_for_web.java:276)

i would check around line 276 of your code (the .java file that's generated, not your .pde).

that stacktrace in full:

Java Plug-in 1.6.0_18
Using JRE version 1.6.0_18-b07 Java HotSpot(TM) Client VM
User home directory = C:\Documents and Settings\koogy

java.lang.reflect.InvocationTargetException
     at com.sun.deploy.util.DeployAWTUtil.invokeAndWait(Unknown Source)
     at sun.plugin2.applet.Plugin2Manager.runOnEDT(Unknown Source)
     at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
     at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.RuntimeException: A null PFont was passed to textFont()
     at processing.core.PGraphics.textFont(PGraphics.java:2476)
     at processing.core.PGraphics.textFont(PGraphics.java:2485)
     at processing.core.PApplet.textFont(PApplet.java:7352)
     at _1_2_10_8_final_for_web.show(_1_2_10_8_final_for_web.java:276)
     at java.awt.Component.show(Unknown Source)
     at java.awt.Component.setVisible(Unknown Source)
     at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable$3.run(Unknown Source)
     at java.awt.event.InvocationEvent.dispatch(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)
Exception: java.lang.reflect.InvocationTargetException
Re: why isnt working online?
Reply #3 - Feb 1st, 2010, 4:28pm
 
yes, everything is included in the data folder + i deleted everything aroung this line and the same happens Cry
Re: why isnt working online?
Reply #4 - Feb 2nd, 2010, 1:45am
 
Usual remark: avoid calling loadImage in draw(), load it in setup() and use it thereafter.
Strange: I also get an out of memory exception on the loadFont call.

Mmm, the verdana_100.vlw font is 3MB, not that much, but perhaps too much for an applet. Not sure about that, I have the standard setting of 60MB, which seems much higher, but Java itself eats lot of memory.

The problem is that until recently, there was no way to specify in the Web page how many memory the applet might need. Since Java 1.6.0_10, we can do that, now: jdk6: Release Notes for the Next-Generation Java™ Plug-In Technology. Before that, each user has to change the memory setting in the Java control panel: How to Increase the Java Applet Memory Limit

I am not sure that's the real problem, but it is worth exploring these settings.
Another solution is to make a smaller font file (export less symbols).
Re: why isnt working online?
Reply #5 - Feb 2nd, 2010, 2:07am
 
i used only one of the two fonts (244 kb) and still it is not running. So, it is not a memory problem or a font problem, at least i think it isnt.
Re: why isnt working online?
Reply #6 - Feb 2nd, 2010, 4:38am
 
what does the java console say? have you tried it using appletviewer? it might be easier to see error messages that way.
Re: why isnt working online?
Reply #7 - Feb 2nd, 2010, 5:47am
 
you have a method called show(). This overrides the show method from PApplet and you should not. Just call your method something else, like showFirst() for example.

Then like PhiLo says, the font is too big, or there are too many characters. And put the stuff you just call once in setup(), not in draw().

cool sketch btw
Re: why isnt working online?
Reply #8 - Feb 2nd, 2010, 6:20am
 
Cheesy alvaro show() mehtod was the problem! thank u all very much / but really, what do u mean by saying PApplet?

and this is what i did:

http://www.openprocessing.org/visuals/?visualID=7318
Re: why isnt working online?
Reply #9 - Feb 2nd, 2010, 6:37am
 
long story...

the reference says "PApplet is the parent Processing class that allows us to have access to all the Processing goodies."

Re: why isnt working online?
Reply #10 - Feb 2nd, 2010, 7:30am
 
Wow, good catch! I wouldn't have thought of this one. I must remember that problem...
Page Index Toggle Pages: 1