Importing ControlP5 with IntelliJ IDEA Processing project

I am new to Processing, but really enjoying it. I am coding in Java (Intellij IDEA) using the PApplet ProcessingCore as a library. I am building an interactive model that will simulate and display switching events on a high voltage power grid. I have the program working beautifully so far. My power grid is behaving the way I want. Now I’m trying to add GUI with buttons and menus, etc. I read up on ControlP5 and it seems like what I need for my project, but I am having a hard time getting IntelliJ to recognize the ControlP5 library. I have downloaded the ControlP5 package and referenced it as a library. My code seems to recognize the import statement, because it is greyed out as an unused import. However, the code will not recognize my variable declaration (final line in code below):

import processing.core.PApplet;
import processing.core.PConstants;
import processing.event.*;
import controlP5.*;

public class Main extends PApplet {

    Viewport viewport = new Viewport();
    Click click = new Click();
    UserInterface ui = new UserInterface();
    ControlP5 cp5;

Below are three screenshots from my project. (Apologies… Forum will only allow me to upload one image since I’m a new user.) First is a screenshot of my libraries. You can see I have a ProcessingCore library (working fine) and the ControlP5 library.

Second is a screenshot of my module dependencies.

Third is a screenshot of my project tree. I can see the ProcessingCore library is referenced but I do not see the ControlP5 library.

I have tried several different combinations of loading the library from some of the sub-folders which contain only Java class files. I have also read the ControlP5 installation instructions several times (not very helpful to me). Need help! What am I missing? Thank you in advance!

1 Like

Welcome to the forum! :slight_smile:

I don’t see the jar in your ControlP5 Library…

I have them as Global Libraries so they are available in all projects, but that’s not necessary.

2 Likes

Thank you Hamoid! I thought Intellij could just find whatever jar files it needed inside whatever folder I link as a library, but once I targeted the jar file as the library everything seems to be working great. I really appreciate you answering!

1 Like

ControlP5 is great but if your controls start to get too complicated I did manage to get processing working from a JavaFX app, it was a bit tricky and needed me to move to eclipse for programming but once up and running it gave much greater options. You can see the sorts of way its used on PoShowTube a youtube video making desktop app.

Thanks I will check it out! Thanks PoBoyd!

That app you developed looks pretty cool Bobby! So save me two months of my life and please answer these questions:

  1. Define “complicated controls” please. I need drop-down menus, fixed buttons and a few context menus (right-click menus). I probably don’t need something like your live control panel in my app (yet). Is ControlP5 going to work for me?
  2. Why would I need to switch to Eclipse?
  3. Seems like the ControlP5 javadocs is rather skimpy on info… did you ever find better documentation or examples anywhere?

While you’re at it (about PoShowTube):

  1. What did you use to generate the music in your demo videos?
  2. I’m especially interested in the lighting effects you use… did you do that with Processing?
  1. yes controlP5 will definitely work for you. I started off that way, mine just got a bit too big.
  2. If yours did turn into a monster it gets difficult to maintain with the processing editor but see how you get on only switch to eclipse(or some other editor) if you need to or really want to use JavaFX.
  3. Yes I think you’re right. It was a quite a while ago since I tried to use it and Im not sure Ive still got the code but shout if youre stuck and ill try dig it out.

PoShowTube

  1. The music attached are my own Po Boyd songs, I used Ableton Live to make them which is great. That was the idea behind PoShowTube really to be able to make a graphics routine based on my song that reacted to the sound and would create a YouTube video.
  2. Yes I must admit Ive been disappointed with the processing lighting effects, I have built them into PoShowTube but they really dont do a great deal. You have to use 3D objects to get something out of them really. PoShowTube has a sphere, cube and pyramid and if on the screen they do show the light but sometimes even then its hard to tell. The PoShowTube lights are pretty configurable so I have tried lots of ways but as I say Ive never managed to get much out of them. I think I had the same problem when writing an Android app which uses OpenGL, which is what processing builds on (I think). Would love to here if anyone else disagrees and just thinks im missing something with the lights.

Found my old PoShowTube processing code before I moved to eclipse/java/javaFX, it has some sample code for controlP5 which might be useful…

1 Like