create radiobutton
in
Contributed Library Questions
•
9 months ago
hello, happy new year!
I built a loop to create radiobutton:
when I click the following message appears:
while I do not code above: (
thank you for reading
I built a loop to create radiobutton:
import controlP5.*;
ControlP5 cp5;
RadioButton RadBut_courbe;
void setup() {
size(200,200);
cp5 = new ControlP5(this);
// RadBut_courbe= cp5.addRadioButton("radioButtonName",50,50);
// r.setSize(100,100);
// r.addItem("itemName",0);
radioButton();
}
void draw() {
background(0);
}
// handles button clicks
//void controlEvent(ControlEvent theEvent) {
//int id = theEvent.controller().id();
// println("got a control event from controller with id "+theEvent.controller().id());
//}
void radioButton() {
// r.setColorBackground(color(192,192,192));
// background(125);
RadBut_courbe = cp5.addRadioButton("COURBA",178,38);// 30, 26
RadBut_courbe.setId(12);
RadBut_courbe. setItemHeight(20);
RadBut_courbe. setItemWidth(20);
RadBut_courbe.setItemsPerRow (1);
RadBut_courbe.setSpacingColumn(10);
RadBut_courbe. setSpacingRow(15);
RadBut_courbe.addItem("A0",0);
RadBut_courbe.addItem("A1",1);
RadBut_courbe.addItem("A2",2);
RadBut_courbe.addItem("A3",3);
RadBut_courbe.addItem("A4",4);
RadBut_courbe.addItem("A5",5);
// RadBut_courbe.setImages(loadImage("imageDefault20_1.png"),loadImage("imageDefault20_1.png"), loadImage("imageActive20_1.png"));
}
when I click the following message appears:
- 7 janv. 2013 20:56:27 controlP5.ControlBroadcaster printMethodError
GRAVE: An error occured while forwarding a Controller value
to a method in your program. Please check your code for any
possible errors that might occur in this method .
e.g. check for casting errors, possible nullpointers, array overflows ... .
method: controlEvent
exception: java.lang.reflect.InvocationTargetException
while I do not code above: (
thank you for reading
1