AnthroYeti
YaBB Newbies
Offline
Posts: 2
Applet not running
Dec 1st , 2009, 9:14am
Greetings, This is my first post, sorry if it should be somewhere else or has already been answered. My problem: I have created a simple applet which displays the results of a query using Twitter4j. Everything works fine when I run it prior to exporting it as an applet. Much of the core code is from the blprnt blog entry. However, when I export it to an applet, I get a Java error saying the program cannot run. So, it works on my machine within the processing window, but no longer after being turned into a Java applet. I tried signing the JAR file as suggested in other forum posts, but no luck. I think there must be something weird about my code and I don't know what it might be. I've also tried the script as well as exporting it to an applet on several computers (Vista 32, Vista 64, and XP) and still no luck. Here is the code (had to change the website for twitter because this is my first post): Twitter twitter; PFont f; void setup() { size(600,100); twitter = new Twitter("login", "pass"); } void draw(){ noLoop(); background(255); f = loadFont("Tahoma-12.vlw"); textFont(f, 14); try{ Query query = new Query("florida"); query.setRpp(1); QueryResult result = twitter.search(query); ArrayList tweets = (ArrayList) result.getTweets(); for (int i = 0; i < tweets.size(); i++) { Tweet t = (Tweet) tweets.get(i); String user = t.getFromUser(); String msg = t.getText(); String url = ("twitter website" + user); Date d = t.getCreatedAt(); fill(0); text("Twitter User: " + user,5,20); text("at " + d,300,20); text("said: " + msg,5,50,590,40); }; } catch (TwitterException te) { println("Couldn't connect: " + te); } } void mousePressed(){ background(255); redraw(); } Here is the Java console error: java.lang.NullPointerException at sun.plugin2.applet.Plugin2Manager.findAppletJDKLevel(Unknown Source) at sun.plugin2.applet.Plugin2Manager.createApplet(Unknown Source) at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source) at java.lang.Thread.run(Unknown Source) Exception: java.lang.NullPointerException A fairly standard error, I think. However, as you can probably tell, I'm very much a novice. Any and all help is much appreciated!