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 & HelpPrograms › InstantiationException problems
Page Index Toggle Pages: 1
InstantiationException problems (Read 621 times)
InstantiationException problems
Feb 8th, 2006, 12:33am
 
Hi,

I've got a Processing sketch called `Trees 3`. You can see the current version here: http://www.3tree.info

I'm currently writing a new version. The first thing I'm trying is a splash screen.

You can see the new code so far: http://pastebin.com/544131 - main file
http://pastebin.com/544138 - thread class

When I run this code, I get a java.lang.InstantiationException: SplashThread

I looked up the JDK API, and an InstantiationException should be triggered by trying to instantiate an interface or an abstract class. As you can see, SplashThread is neither.

Could anyone help me out in trying to figure out what the problem is?

Thanks
-bloopletech
Re: InstantiationException problems
Reply #1 - Feb 8th, 2006, 7:24pm
 
I'm not sure if this is documented or a mac thing, but when I rename SplashThread to SplashThread.java, it works fine. The really interesting (disturbing) thing is that the suffix doesn't need to be on the file, after I specify the.java once in processing. I can then remove .java from the file, and it will still work. I can even, using tabs>rename change SplashThread.java to SplashThread and it will still work and the tab itself will still maintain the .java

Re: InstantiationException problems
Reply #2 - Feb 18th, 2006, 9:24pm
 
renaming to SplashThread.java will tell the preproc to lay off and not integrate that code into the main PApplet class. sounds like there's code in SplashThread that's not happy being an internal class.

as for the renaming not getting rid of the .java, that's a bug, if you care to file it in the bugs db.
Page Index Toggle Pages: 1