Problem Importing ControlP5 in IntelliJ IDEA (used with Processing Core)

445 Views Asked by At

I am developing an interactive program to simulate power grid switching and I have it working beautifully with the rendering tools in the Processing library. Now I want to add a user interface with menus and buttons, etc. I found the ControlP5 library and it seems like what I need, but I am having a hard time importing it into my project. I have the most current ControlP5 folders/files on my machine and I have added them as a project library. IntelliJ is recoginizing my import statement, but it won't let me declare a variable using the ControlP5 class.

My import statement seems good to go... it is greyed out as an unused import.

But the very last line in the code copied here generates an error "Cannot resolve symbol 'ControlP5'"

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;

Here is a screen shot of my libraries. I have the Processing Core library which I am using for drawing tools, and I want to also use classes from the ControlP5 library which I believe I have correctly linked as an external library here.

Libraries

Here is a screen shot of my module dependencies.

Module Dependencies

Here is a screen shot of the bottom of my project tree. I can see that Processing is correctly shown, but I do not see the ControlP5 library here.

Project Tree

I have tried multiple different methods of adding just certain subfolders of the "controlp5-master" folder which I downloaded with no luck. I have also searched through Google, Processing forum, and Stack Overflow and can't find an answer.

Any advice?

1

There are 1 best solutions below

0
On BEST ANSWER

My problem was solved on the Processing Forum. I simply referenced the wrong file when establishing my external library. The ControlP5 download package includes a jar file that is buried several folders deep. Once I pointed the library to that jar file, I was in business.