FAQ
Cover
This is the archive Discourse for the Processing (ALPHA) software.
Please visit the new Processing forum for current information.

   Processing 1.0 _ALPHA_
   Programming Questions & Help
   Integration
(Moderators: fry, REAS)
   processing and eclipse
« Previous topic | Next topic »

Pages: 1 
   Author  Topic: processing and eclipse  (Read 649 times)
capeta


processing and eclipse
« on: Nov 26th, 2004, 8:38pm »

hi, i managed to make processing work on eclipse. but there is a problem i ran into.
 
here is the source (well, shorted down)
 
public class World extends BApplet
{
    NClass cNClass;
    World()
    {
    }
    public void init()
    {
   cNClass = new NClass();
    }
}
public class NClass extends World
{
    BImage img;
    NClass()
    {
   img = loadImage("image.gif");
    }
}
 
it gives me :
java.lang.NullPointerException
 at BApplet.loadImage(BApplet.java:2750)
 at EnemyControl.init(EnemyControl.java:21)
 at World.init(World.java:24)
 at JaxTon.setup(JaxTon.java:51)
 at BApplet.init(BApplet.java:185)
 
i think (maybe) its because the images files are in the wrong directory ? i did put them over /data/ on my /bin/ directory (my output folder).
 
missing something ? havent seen this anywhere over here.
 
thanks in advance!
« Last Edit: Nov 27th, 2004, 8:24pm by capeta »  
rgovostes

rgovostes
Re: processing and eclipse
« Reply #1 on: Nov 27th, 2004, 3:53am »

Looks like that would make an infinite loop to me, similar to doing
 
Code:
public class InfiniteLoop {
  InfiniteLoop {
    InfiniteLoop crashme = new InfiniteLoop;
  }
}

 
...
 
capeta


Re: processing and eclipse
« Reply #2 on: Nov 27th, 2004, 8:23pm »

i know! they are on a init method. thats not my problem.
the problem is that its returning an NullPointerException  
even if i code img under the class that extends the BApplet class.
 
has anybody out in the world ran into that problem ?
crap
 
capeta


Re: processing and eclipse
« Reply #3 on: Nov 27th, 2004, 10:24pm »

does loadImage always look up /data/ directory ?
 
capeta


Re: processing and eclipse
« Reply #4 on: Nov 28th, 2004, 6:19pm »

ok, i got it now:
 
class MClass extends BApplet
{
     SClass cSClass;
 MClass()
 {
 }
 
 public void init()
 {
      cSClass= new SClass( this );
 }
}
 
class SClass extends MClass
{
 MClass parent;
 LoClass cLoClass;
 SClass( MClass parent )
 {
  this.parent = parent;
 }
 public void init()
 {
  cLoClass = new LoClass( parent );
 }
}
class LoClass extends SClass;
{
 MClass parent;
 BImage img;
 LoClass( Mclass parent )
 {
  this.parent = parent;
  //!!!!!!!!!!!!!!!!!!!!!
  // this was the only way i got it to work. dont know if its right. but it works for me
  // img = -> "parent."<-loadImage( "s.gif" );
  //!!!!!!!!!!!!!!!!!!!!!
  img = parent.loadImage( "s.gif" );
 }
}
« Last Edit: Nov 28th, 2004, 6:21pm by capeta »  
gll

WWW Email
Re: processing and eclipse
« Reply #5 on: Dec 23rd, 2004, 5:06pm »

Nice!
 

guillaume LaBelle
toxi

WWW
Re: processing and eclipse
« Reply #6 on: Dec 23rd, 2004, 6:18pm »

there's a tutorial about P5 and eclipse incl. an ANT export script over in this thread.
 

http://toxi.co.uk/
Pages: 1 

« Previous topic | Next topic »