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 › error nullpointerexceptoin
Page Index Toggle Pages: 1
error nullpointerexceptoin (Read 302 times)
error nullpointerexceptoin
Mar 20th, 2006, 11:22am
 
hi,

my problem is, that the script runs for 2-5 seconds and then the error is shown.

error:

java.lang.NullPointerException
at processing.core.PGraphics.text(PGraphics.java:2007)
at processing.core.PApplet.text(PApplet.java:6468)
at Temporary_8588_3583.draw(Temporary_8588_3583.java:28)
at processing.core.PApplet.display(PApplet.java:1326)
at processing.core.PGraphics.requestDisplay(PGraphics.java:525)
at processing.core.PApplet.run(PApplet.java:1142)
at java.lang.Thread.run(Unknown Source)

java.lang.NullPointerException

at processing.core.PGraphics.text(PGraphics.java:2007)

at processing.core.PApplet.text(PApplet.java:6468)

at Temporary_8588_3583.draw(Temporary_8588_3583.java:28)

at processing.core.PApplet.display(PApplet.java:1326)

at processing.core.PGraphics.requestDisplay(PGraphics.java:525)

at processing.core.PApplet.run(PApplet.java:1142)

at java.lang.Thread.run(Unknown Source)


java.io.IOException: Stream closed.
at java.net.PlainSocketImpl.available(Unknown Source)
at java.net.SocketInputStream.available(Unknown Source)
at processing.net.Client.run(Client.java:149)
at java.lang.Thread.run(Unknown Source)
java.lang.RuntimeException: Error inside Client.run()
at processing.core.PApplet.die(PApplet.java:2078)
at processing.core.PApplet.die(PApplet.java:2096)
at processing.net.Client.errorMessage(Client.java:441)
at processing.net.Client.run(Client.java:179)
at java.lang.Thread.run(Unknown Source)


Code:

import processing.net.*;

Client test;
String input;


PFont font;

void setup () {
size (200,200);

test = new Client (this,"127.0.0.1",2000);

font = loadFont("font.vlw");

framerate (10);


}

void draw (){

background (0);
input = test.readString();
fill (200);
//translate (0,20);
textFont(font,20);
text (input,10,10);

}



i dont know what i have to do i hope you can help me.

greez
Tschdaeff
Page Index Toggle Pages: 1