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 › class cast exception in java mode
Page Index Toggle Pages: 1
class cast exception in java mode (Read 899 times)
class cast exception in java mode
Sep 6th, 2005, 8:13pm
 
Hi all,

I've just started porting some stuff from eclipse to the latest processing (091) and am getting a Java.Lang.ClassCastException as soon as I try and use a class in a second tab.

//tab window 1
public class myfirstclass extends PApplet
{
 public void setup( ) {
   size(640,480, JAVA2D);
 }
 public void draw() {
 }
}

//tab window 2
public class mysecondclass
{
 public mysecondclass(){
 }
}

anyone have some idea as to what's going wrong here?

cheers

james
Re: class cast exception in java mode
Reply #1 - Sep 7th, 2005, 6:45am
 
try removing the "public" from the class in the second tab, it might be confusing the preprocessor.

the code from the tabs are all appended together, so you also can't have two "public" classes in the same file.

if you want to just do straight java stuff, you can include .java in the name when creating a new tab, and it'll treat it as its own file rather than smooshing it in with the others.
Re: class cast exception in java mode
Reply #2 - Sep 7th, 2005, 10:02am
 
that's sorted it. excellent, thanks Ben.
Page Index Toggle Pages: 1