Good afternoon, when I click on the checkbox, the Rebook inscription appears at the bottom, but with Radio1 and Radio2 it does not appear with the NIKE inscription.
import controlP5.*;
ControlP5 cp5;
int myColorBackground = color(128);
Textlabel TEST;
Textlabel TEST2;
void setup() {
size(700, 400);
noStroke();
cp5 = new ControlP5(this);
cp5.addTab(“extra”)
.setColorBackground(color(0, 160, 100))
.setColorLabel(color(255))
.setColorActive(color(255, 128, 0))
;
cp5.getTab(“extra”)
.activateEvent(true)
.setId(1)
;
cp5.addCheckBox(“checkBox1”)
.setPosition(100, 100)
.setSize(40, 40)
.setItemsPerRow(3)
.setSpacingColumn(30)
.setSpacingRow(20)
.addItem(“checkBox”, 0)
.moveTo(“extra”)
;
TEST = cp5.addTextlabel(“PPP”)
.setVisible(false)
.setText(“Rebook”)
.setColor(color(#00ffff))
.setPosition(100, 150)
.moveTo(“extra”)
;
cp5.addRadioButton(“radioButton”)
.setPosition(220, 110)
.setSize(40, 20)
.setColorForeground(color(120))
.setColorActive(color(255))
.setColorLabel(color(255))
.setItemsPerRow(5)
.setSpacingColumn(50)
.addItem(“radio1”, 1)
.addItem(“radio2”, 2)
.moveTo(“extra”)
;
TEST2 = cp5.addTextlabel(“DDD”)
.setVisible(false)
.setText(“NIKE”)
.setColor(color(#00ffff))
.setPosition(270, 150)
.moveTo(“extra”)
;
}
public void radioButton (float a)
{
if (a[0]==1) {
TEST2.setVisible(true);
} else {
TEST2.setVisible(false);
}
println(a);
}
public void checkBox1 (float a)
{
if (a[0]==1) {
TEST.setVisible(true);
} else {
TEST.setVisible(false);
}
println(a);
}
void draw() {
background(myColorBackground);
} </>