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 constructor with a list
Page Index Toggle Pages: 1
Class constructor with a list (Read 364 times)
Class constructor with a list
Mar 22nd, 2009, 6:22pm
 
Hello everyOne !

I would like to know if it's possible to have a Pimage list in a class and if yes what's the syntax to declare the list in the class's constructor. Thank's
Re: Class constructor with a list
Reply #1 - Mar 22nd, 2009, 8:18pm
 
class StuffWithImages
{
 ArrayList images = new ArrayList();
 StuffWithImages()
 {
   // Do stuff, might do the new here if you prefer
 }
 void AddImage(PImage pi)
 {
   images.add(pi);
 }
}

and so on.
Page Index Toggle Pages: 1