Class FXMLDocumentControlle.java package javafxapplication27; import com.jfoenix.controls.JFXRadioButton; import java.net.URL; impo...
Class FXMLDocumentControlle.java
package javafxapplication27;
import com.jfoenix.controls.JFXRadioButton;
import java.net.URL;
import java.util.ResourceBundle;
import javafx.fxml.FXML;
import javafx.fxml.Initializable;
import javafx.scene.control.ToggleGroup;
import javafx.scene.paint.Color;
/**
*
* @author amir
*/
public class FXMLDocumentController implements Initializable {
@FXML
private JFXRadioButton r1;
@FXML
private JFXRadioButton r2;
@FXML
private JFXRadioButton r3;
@FXML
private JFXRadioButton r4;
ToggleGroup groupe = new ToggleGroup();
@Override
public void initialize(URL url, ResourceBundle rb) {
r1.setToggleGroup(groupe);
r2.setToggleGroup(groupe);
r3.setToggleGroup(groupe);
r4.setToggleGroup(groupe);
r1.setSelectedColor(Color.RED);
r2.setSelectedColor(Color.BLUE);
r3.setSelectedColor(Color.YELLOW);
r4.setSelectedColor(Color.PURPLE);
r1.setUnSelectedColor(Color.RED);
r2.setUnSelectedColor(Color.BLUE);
r3.setUnSelectedColor(Color.YELLOW);
r4.setUnSelectedColor(Color.PURPLE);
}
}
COMMENTS