Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use Processing 3 on IntelliJ IDEA?

I'd like to use the IntelliJ IDEA IDE to develop some app using Processing 3. How can I do that ?

There are only tutorials on how to use Processing 2, but I think things have changed enough so that those tutorials do not work anymore.

Thank you

like image 556
ypicard Avatar asked Apr 21 '16 09:04

ypicard


2 Answers

It's hard to answer general "how do I do this" type questions. Stack Overflow is designed more for "I tried X, expected Y, but got Z instead" type questions. You'll have much better luck if you try something out and post an MCVE along with a specific question if you get stuck. You say you think things have changed enough so that those tutorials don't work anymore- could you test that assumption by trying it out?

Because those tutorials will still work. A few things have changed, such as the removal of the ability to embed a PApplet directly into a Swing application. But 90% of the rest of the tutorials should work fine.

Step 1: Add the Processing library to your classpath. This includes the core and any JOGL dependencies you need.

Step 2: Create a class that extends PApplet and add your code there.

Step 3: Call PApplet.main("YourSketchNameHere"); to launch your sketch.

Here is a little example that shows those steps:

import processing.core.PApplet;

public class ProcessingTest extends PApplet{

    public void settings(){
        size(200, 200);
    }

    public void draw(){
        background(0);
        ellipse(mouseX, mouseY, 20, 20);
    }

    public static void main(String... args){
        PApplet.main("ProcessingTest");
    }
}

Please try something out and post a specific question if you get stuck. Good luck.

Shameless self-promotion: I wrote a tutorial on using Processing as a Java library, available here.

like image 135
Kevin Workman Avatar answered Nov 14 '22 17:11

Kevin Workman


I up voted Kevin's answer but also went ahead and created a gradle project that you can use with or without an IDE or processing. Git Commit to processing project

Edit doesn't work for video libraries. i tried to get the libraries needed but that is not my best area and have resorted to use P3 for those projects.

like image 25
mavriksc Avatar answered Nov 14 '22 19:11

mavriksc