|
SpringGUI
introduction download reference examples faq
Reference
Name
|
addRadiobutton()
|
Examples
|
SpringGUI gui;
void setup() {
size(200,200);
gui = new SpringGUI(this); // initialise SpringGUI
// Create a Radiobutton named "myRadiobutton1" at coordinates 10,10 with width 200px and height 25px...
gui.addRadiobutton("myRadiobutton1", "I am a Radiobutton", "myGroup", 10, 10, 200, 25);
// Create another Radiobutton in the same group
gui.addRadiobutton("myRadiobutton2", "I am another Radiobutton", "myGroup", 10, 10, 200, 25);
gui.setState("myRadiobutton1", true); // check the first Radiobutton
}
|
Description
|
Creates a Radiobutton element. A Radiobutton is like a Checkbox, with the exception that only one Radiobutton in a group of Radiobuttons can be checked at a time. You specify which group a Radiobutton belongs to when you create it. Whenever you create a Radiobutton with a new group name, the group will be automatically created.
|
Syntax
|
gui.addRadiobutton(name, text, group, x, y, width, height);
|
Parameters
|
String name
|
The name of the element. You can query and change the element's attributes later on by referring to this name.
|
String text
|
The text to display on the Radiobutton.
|
String group
|
The group to which the Radiobutton belongs. If you specify a previously non-existant group name, a new group will automatically be created by that name. Of all Radiobuttons belonging to a given group, only one can be checked at a time.
|
int x, int y
|
The x and y coordinates of the element's top left point.
|
int width, int height
|
The size of the element.
|
|
Returns
|
nothing
|
Related
|
getState(), setState()
getSelectedRBN()
addCheckbox()
table of events
|
back to the top of the page
|
| |
| | |