ControlP5 - controlWindow | controlFrame, ConcurrentModificationError
I have a problem creating a controlWindow resp. controlFrame. I'm using controlP5 with Java (Eclipse) and have a main PAplett class where you can do stuff. At the time of creating the main window, a controlWindow is opened where I put all my controls to change the behaviour in my main window. I used controlWindow and everything works but from time to time (maybe every 1 of 10 programmstarts) I get an ConcurrentModificationError while initializing the controlWindow. But I can't explain where it comes from. Both windows open, my main window looks good, my controlWindow is either complete empty or half of the buttons are there (when it's like this, it "ends" every time at the same button!). In the other 9 of 10 starts everything really works properly.
Now I read, that controlWindow shouldn't be used anymore with ControlP5 2.0+. So I wanted to use ControlFrame but don't get the example (http://www.sojamo.de/libraries/controlP5/examples/extra/ControlP5frame/ControlP5frame.pde) working. I created a 2nd class (the ControlFrame) which extends PAplett too like my main window. In my main window I can create an instance of ControlP5 (cp5=new ControlP5(this)). At the exact same line of code in my 2nd window/class I get an NullPointerException.
As I understand controlP5 correctly I have two classes which are both extending from PAplett, both of them creating a new instance of controlP5, where I add all my buttons and stuff from each window respectively. It is possible to run the 2nd window alone (which I don't need) and everything looks/starts fine (it can't work because i need my main window). When I'm starting my program with my main window I do get this NullPointer. Why is that?
The next problem I'm not sure if that has to do with the problem above is, if i use the very new controlP5 library from october I even can't write c5 = new ControlP5(this) in my main window. I instantly get an exception and no window opens.