use of com.jfoenix.controls.JFXCheckBox in project JFoenix by jfoenixadmin.
the class CheckBoxDemo method start.
@Override
public void start(Stage stage) {
FlowPane main = new FlowPane();
main.setVgap(20);
main.setHgap(20);
CheckBox cb = new CheckBox("CheckBox");
JFXCheckBox jfxCheckBox = new JFXCheckBox("JFX CheckBox");
JFXCheckBox customJFXCheckBox = new JFXCheckBox("JFX CheckBox");
customJFXCheckBox.getStyleClass().add("custom-jfx-check-box");
main.getChildren().add(cb);
main.getChildren().add(jfxCheckBox);
main.getChildren().add(customJFXCheckBox);
StackPane pane = new StackPane();
pane.getChildren().add(main);
StackPane.setMargin(main, new Insets(100));
pane.setStyle("-fx-background-color:WHITE");
final Scene scene = new Scene(pane, 600, 200);
scene.getStylesheets().add(CheckBoxDemo.class.getResource("/resources/css/jfoenix-components.css").toExternalForm());
stage.setTitle("JFX CheckBox Demo ");
stage.setScene(scene);
stage.setResizable(false);
stage.show();
}
use of com.jfoenix.controls.JFXCheckBox in project JFoenix by jfoenixadmin.
the class JFXCheckBoxSkin method playSelectAnimation.
private void playSelectAnimation(Boolean selection) {
if (selection == null)
selection = false;
JFXCheckBox control = ((JFXCheckBox) getSkinnable());
transition.setRate(selection ? 1 : -1);
select.setRate(selection ? 1 : -1);
transition.play();
select.play();
box.setBorder(new Border(new BorderStroke(selection ? control.getCheckedColor() : control.getUnCheckedColor(), BorderStrokeStyle.SOLID, new CornerRadii(2), new BorderWidths(lineThick))));
}