processing not working

hello all, previously i was using a jcreator java ide for using processing sketches in java but the ide got outdated so i switched to netbeans ,however when i tried to import processing libraries and run basic sketches it throws an error

run:
Usage: PApplet <appletname>
For additional options, see the Javadoc for PApplet
Java Result: 1
BUILD SUCCESSFUL (total time: 1 second)

please help

Answers

  • First create a package and call it main. Then create 2 .java files. In the first one type this code and call it RunProcessing.java

    package main;
    
    import processing.core.PApplet;
    
    public class RunProcessing extends PApplet {
        public static final boolean fullscreen = false;
    
           public static void main(String args[]) {
               if(fullscreen)
               {
                  PApplet.main(new String[] { "--present", "main.ExampleProcessing" });
               }
               else
               {
                  PApplet.main(new String[] { "main.ExampleProcessing" });
               }
           }
    
    }
    

    In the second one you can place your actual Processing code and call it ExampleProcessing.java Notice you can change the names by renaming main.ExampleProcessing inside RunProcessing.java

    package main;
    
    import processing.core.*;
    
    public class ExampleProcessing extends PApplet {
        //Your code here
        public void setup() {
            size(640, 480);
            background(0);
    
          }
    }
    
Sign In or Register to comment.