Neosoul
YaBB Newbies
Offline
Posts: 3
I get this error in my program
Mar 2nd , 2007, 9:41pm
ControlP5 0.1.1 infos, comments, questions at http://www.sojamo.de/controlP5 ERROR. an error occured while forwarding a Controller value to a method in your program. please check your code for any possible errors that might occur in this method . e.g. check for casting errors, possible nullpointers, array overflows ... . method: printText exception: java.lang.reflect.InvocationTargetException /** * controlP5texfield by andreas schlegel * textfield is a controller for single line text input. * controlP5 website at http://www.sojamo.de/controlP5 */ import controlP5.*; ControlP5 controlP5; int myColorBackground = color(0,0,0); /* the textValue field will be used as unique name for a textfield * controller below, hence it will be automatically updated by controlP5 * if changes are made to the controller. mkae sure the field is * public so that the automatic update will work and now security exception * will occur. */ public String textValue = ""; public String name =""; public String email =""; public String phone = ""; public PrintWriter output; PFont myFont; PImage e; void setup() { size(400,600); controlP5 = new ControlP5(this); controlP5.addTextfield("name",100,80,200,20); controlP5.addTextfield("email",100,120,200,20); controlP5.addTextfield("phone",100,160,200,20); controlP5.addBang("printText",100,200,100,20); output = createWriter("info.txt"); // Create a new file in the sketch directory } void draw() { background(myColorBackground); e = loadImage("enter.jpg"); image(e, 0, 0); } /* controlP5 checks each controller's unique name when created. * if the name equals a method or field in your sketch, then controlP5 * will forward events triggered by a controller to its applicable * method or field. */ /* void texts(String theText) { println("texts : "+theText); } */ void printText() { /* println("Name: "+name); println("Email: "+email); println("Phone:"+phone); */ output.println(name);// Write to the file output.println(email);// Write to the file output.println(phone);// Write to the file output.flush(); // Writes the remaining data to the file output.close(); // Finishes the file } I am new to processing but have a good understanding of programming but I havent gotten this error before. Can anyone help me?