Class JFXSliderExampleController.java package javafxapplication27; import com.jfoenix.controls.JFXSlider; import java.net.URL; imp...
Class JFXSliderExampleController.java
package javafxapplication27;
import com.jfoenix.controls.JFXSlider;
import java.net.URL;
import java.util.ResourceBundle;
import javafx.fxml.FXML;
import javafx.fxml.Initializable;
import javafx.scene.input.MouseEvent;
import javafx.scene.layout.AnchorPane;
/**
* FXML Controller class
*
* @author amir
*/
public class JFXSliderExampleController implements Initializable {
@FXML
private AnchorPane p;
@FXML
private JFXSlider red;
@FXML
private JFXSlider blue;
@FXML
private JFXSlider green;
@FXML
void rgb(MouseEvent event) {
int r = (int)red.getValue();
int b = (int)blue.getValue();
int g = (int)green.getValue();
p.setStyle("-fx-background-color:rgb("+r+","+b+","+g+")");
}
@Override
public void initialize(URL url, ResourceBundle rb) {
// TODO
}
}
COMMENTS