0

I'm doing a port over of codes from Processing to Netbeans Java. I'm having problems running multiple java classes. My codes are spread out into 14 classes, where my main class include only this set of codes:

package gardeningmania;

import java.io.File;
import processing.core.*;

public class GardeningMania extends PApplet{

    public static void main(String[] passedArgs) {
        File currentDir = new File("."); getAllFilse(currentDir);
        PApplet.main(new String[]{/*"--present",*/"gardeningmania.GardeningMania"});
    }

    public static void getAllFilse(File currentDir) {
        File[] filesList = currentDir.listFiles(); 
        for(File f : filesList){ 
            if(f.isDirectory()) getAllFilse(f); 
            if(f.isFile()){ System.out.println(f.getName()); }
        }
    }
}

Whenever the project is being run, only a small screen will pop-up with a gray background, however, that's all it shows. It seems to me that it's unable to read all my codes from the other 13 classes. Any ideas, anyone?

Keppil
  • 45,603
  • 8
  • 97
  • 119
user3197096
  • 31
  • 2
  • 4
  • 1
    Your `PApplet` does not seem to include a `setup()` or `draw()` method, which explains why all you see is a small window with no activity. Do you see any exceptions in your console? Do the files in your current directory print to your console? – Nathaniel Jones Jan 26 '14 at 21:15

1 Answers1

0

Applets don't use a main()-method; you have to implement other Methods instead:

void init();
void start();
void stop();
void destroy();

By default, the class Applet doesn't implement them, they all have only an empty block.

Please see:

Community
  • 1
  • 1
ollo
  • 24,797
  • 14
  • 106
  • 155