Skip to main content

How to set whether or not SUICheckBox by script using Java

In your Java class, do the following:

public class YourClass extends Component {

// boolean to control whether the SUICheckBox will be checked or unchecked
public boolean value; // select in the properties the value (true or false)

// creates a new SUICheckBox, @AutoWired selects the component from this object
@AutoWired
private SUICheckBox checkBox;

@Override
public void start() {

}

@Override
public void repeat() {

// defines whether the SUICheckBox is checked or unchecked according to the value of the boolean (true or false) "value"
checkBox.setPressed(value);
}
}